Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-21-2011, 07:05 PM
James T Brock James T Brock is offline
 
Join Date: Sep 2004
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Disallow ALL moderation in archive subforum?

I have an archive forum where I do NOT want anyone, including other admins and global mods to have the ability to moderate. How do I do this?

This is the relevant code in editpost.php

Code:
if (!$postinfo['postid'] OR $postinfo['isdeleted'] OR (!$postinfo['visible'] AND !can_moderate($threadinfo['forumid'], 'canmoderateposts')))
What do I add there so that if the forumid is 20 no one will be able to edit/delete a post in that specific forum even if they're admins or global mods?

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

No one knows how to do this? Seems like it should be relatively simple for a coder. I just need to know what php code would be the equivalent of "AND is not forumid=xx" and add that right before the canmoderateposts part. That way if all of those conditions are present AND it's NOT that forumid then they can moderate, otherwise they can't.

OR does anyone have an alternate suggestion for what to add as a conditional in the postbit template?
Reply With Quote
  #2  
Old 09-25-2011, 01:27 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could do this:

Code:
if (   !$postinfo['postid'] OR $postinfo['isdeleted'] OR 
       (!$postinfo['visible'] AND !can_moderate($threadinfo['forumid'], 'canmoderateposts')) OR
       $threadinfo['forumid'] == 20
   )

I haven't looked at the code, I'm just going by what you posted.


The above would make it so no one could moderate it at all. If you want to be able to moderate it yourself, you could add this:

Code:
if (   !$postinfo['postid'] OR $postinfo['isdeleted'] OR 
       (!$postinfo['visible'] AND !can_moderate($threadinfo['forumid'], 'canmoderateposts')) OR
       ($threadinfo['forumid'] == 20 && $vbulletin->userinfo['userid'] != X)
   )

where you'd replace X with your userid.
Reply With Quote
  #3  
Old 10-03-2011, 06:14 PM
James T Brock James T Brock is offline
 
Join Date: Sep 2004
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, thanks for your reply! I don't know what I was thinking, that's not the right page at all.

The correct page is class_postbit.php and the relevant code is:

Code:
	// hide edit button if they can't use it
		$forumperms = fetch_permissions($this->thread['forumid']);
		if (
			!$this->thread['isdeleted'] AND !$this->post['isdeleted'] AND (
			can_moderate($this->thread['forumid'], 'caneditposts') OR
			can_moderate($this->thread['forumid'], 'candeleteposts') OR
			(
				$this->thread['open'] AND
				$this->post['userid'] == $this->registry->userinfo['userid'] AND
				($forumperms & $this->registry->bf_ugp_forumpermissions['caneditpost']) AND
				(	$this->post['dateline'] >= (TIMENOW - ($this->registry->options['edittimelimit'] * 60)) OR
					$this->registry->options['edittimelimit'] == 0
				)
			))
		)
Also shouldn't that be AND instead of OR? And I can't figure out how to insert the "AND $threadinfo['forumid'] == 20" part, it does what I want but the code doesn't seem to be in the right syntax. Any help would be appreciated.



edit: I think I figured it out!

Code:
AND $this->thread['forumid'] != XXX
Can't get the userid thing to work though.
Reply With Quote
Reply


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 01:21 AM.


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.03584 seconds
  • Memory Usage 2,179KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)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_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
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete