View Single Post
  #4  
Old 08-14-2013, 11:24 PM
juzz86 juzz86 is offline
 
Join Date: May 2013
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thankyou both very much for your time, and my apologies for the lack of detail. This end of vB and php in general is all quite new to me, I've been Moderating for years but the step up to Admin requires more of this kind of stuff, and I must admit I'm just feeling my way through for the most part. I appreciate you guys taking time out to help me thus far - thankyou.

Justin from Australia

Quote:
Originally Posted by Lynne View Post
What hook location are you using? That is what will determine the variable you use.
Hi Lynne, I may have used the incorrect term there sorry! Some further details on the Forum for you to give some background. This should've come last night - my apologies:

I co-Admin a small cell phone sale/trade forum. We have some reasonably hefty restrictions on our new memberships currently - thread creation is completely disabled, until a positive transaction is recorded against their name and we manually promote to Members after this. As we are a small forum and a close-knit staff, we don't oppose the level of manual work to keep our forum as evil-free as feasibly possible.

This has worked well for us so far, however we are in the midst of partnering with a news site to provide us a nice portal (and more users), and would like to relax the thread creation restrictions in aid of encouraging new members a bit more.

Thus, I am hoping to be able to use the little bit of code I found last night to put a 'catch' in the newpost rules, that any thread posted into forumID 41, by usergroup 2, is automagically placed in the moderation queue. The aim is to avoid moderating their negotiation back-and-forth posts, and just moderate all OPs by that usergroup.

Quote:
Originally Posted by tbworld View Post
I know the section of code you are talking about in 'newpost.php', but I am wondering if this is necessary. Your allowed to select moderators to a forum, you are also allowed to set if a usergroup will follow moderation. You might be able to do this without the hack -- depending how strict your permission system is.

To answer your question:

Code:
is_member_of($vbulletin->userinfo,  Y)
Where Y is equl to a valid usergroup id -- is valid vb code as long as '/includes/functions.php' is loaded and in most cases it already is.

Then you just need to alter the permission in 'newpost.php' listed below.

Code:
        // see if post has to be moderated or if poster in a mod
        if (
            ((
                (
                    ($foruminfo['moderatenewthread'] AND $type == 'thread') OR ($foruminfo['moderatenewpost'] AND $type == 'reply')
                )
                OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['followforummoderation'])
            )
            AND !can_moderate($foruminfo['forumid']))
            OR
            ($type == 'reply' AND (($postinfo['postid'] AND !$postinfo['visible'] AND !empty($postinfo['specifiedpost'])) OR !$threadinfo['visible']))
        )
You might be able to use the hook: 'newpost_process' with some clever programming or just add your own custom hook, if you do not want to alter the code directly.

I could have been more helpfull, but you did not explain how you were going to manipulate the usergroup data into the function 'build_new_post'. Hopefully, I helped with something...
This has been very helpful tbworld, thankyou. As I mentioned above this is very new to me, and I'm still learning how everything ties in together in the backend. Ideally all posts, except those from usergroup 2, would avoid moderation. This is done easily enough, however as there is no real way to moderate threads only per-usergroup, I was hoping to make something similar to this (very crude, sorry):

Code:
if usergroup == Junior AND == newthread AND forumid == 41 THEN visible == 0
We're just hoping to avoid two things:

1) Moderating all new threads for forumid 41 (easily achieveable but detrimental to our established userbase)

2) Moderating every single post for usergroup 2 in forumid 41.

I hope this clarifies a little. Again, sorry for my lack of understanding

Justin
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01184 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete