Jump to content


* * * * * 1 votes

IP.Board 2.3: Make Root Admins' Posts Un-editable by Moderators


  • Please log in to reply
7 replies to this topic

#1 RuneCore

RuneCore

    <(^^,)>

  • IM Supporters
  • PipPipPipPipPipPipPip
  • 719 posts
  • Location:Texas
  • Real Name:JB
  • IPB Version:v2.3.x
Contributor

Posted 22 November 2007 - 01:04 AM

This is the support topic for the tutorial Make Root Admins' Posts Un-editable by Moderators.  Please post here if you have any questions or feedback.

#2 RuneCore

RuneCore

    <(^^,)>

  • IM Supporters
  • PipPipPipPipPipPipPip
  • 719 posts
  • Location:Texas
  • Real Name:JB
  • IPB Version:v2.3.x
Contributor

Posted 22 November 2007 - 01:09 AM

I should clarify that all this does is make it so that the edit / delete buttons on a Root Admin's posts do not appear for anyone other than fellow Root Admins. It does not take away the abilities, just the links to them.
Posted Image
http://www.virtualdump.net
--------------
My Mods:
[RC23]Songs in Profiles / Demo
^Winner of the Best Medium Mod of October 2007 award on Invisionize
^Second place in the Semi-Annual Mod Competition
[RC23]Individual Member Adsense
^Winner of the Best Medium Mod of November 2007 award on Invisionize
[RC22]Messenger Icons in Topic View
[RC23]Banned Sig Replacement
More...

Posted Image

#3 Depot

Depot

    Invision Modding.com Helper - Type - Person

  • IM Supporters
  • PipPipPipPipPipPipPipPipPipPip
  • 5,573 posts
  • Location:NE Florida
  • Real Name:Larry C
  • IPB Version:v2.3.x
Contributor

Posted 22 November 2007 - 01:12 AM

Nice work RC!  ;)

- - - - nsMod Community Forums - - - -

Posted Image Services System Modification Installation FAQ Invision Modding Store Posted Image

I DO: IPB UPGRADES, MOD INSTALLS, DATABASE BACKUPS & RESTORATION, CUSTOM SKINS, SITE TRANSFERS

IMPORTANT - READ THIS BEFORE YOU PM ME!!!

Do not ask me for assistance / provide me with your url if you own a nullified board - IM Staff will be notified.


#4 ski

ski

    n00b

  • Members
  • Pip
  • 2 posts
  • IPB Version:N/A

Posted 27 November 2007 - 09:22 PM

View PostRuneCore, on Nov 21 2007, 08:09 PM, said:

I should clarify that all this does is make it so that the edit / delete buttons on a Root Admin's posts do not appear for anyone other than fellow Root Admins. It does not take away the abilities, just the links to them.

Exactly http://www.site.com/[dir]/index.php?act=post&do=edit_post&f=<NUM FORUM>&t=<TOPIC NUMBER>&p=<NUM POST>&st=0 is the PoC...

the only thing you do with this is "hide" the option, but it is still there...

another way to REALLY get this?

#5 RuneCore

RuneCore

    <(^^,)>

  • IM Supporters
  • PipPipPipPipPipPipPip
  • 719 posts
  • Location:Texas
  • Real Name:JB
  • IPB Version:v2.3.x
Contributor

Posted 27 November 2007 - 10:48 PM

Calypso posted this on invisionize, but it would still show the buttons. Combined with mine, it should do exactly what you want:

Open: sources/classes/class_post_edit.php

Find:
		//-----------------------------------------
		// Load the old post
		//-----------------------------------------
		
		$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'posts', 'where' => "pid=".intval($this->ipsclass->input['p']) ) );
		$this->ipsclass->DB->simple_exec();
		
		$this->orig_post = $this->ipsclass->DB->fetch_row();
		
		if (! $this->orig_post['pid'])
		{
			$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
		}
Add Below:
		if ( $this->ipsclass->member['mgroup'] != 4 )
		{

		$data = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'mgroup',
															   'from'   => 'members',
															   'where'  => 'id='.$this->orig_post['author_id'],
													  )		 );

		if ( $data['mgroup'] == 4 )
		{
			$this->ipsclass->Error( array( LEVEL => 1, MSG => 'root_admin') );
		}

		}
Save & Upload

Open: cache/lang_cache/en/lang_error.php

Find:
);

?>
Add Above:
'root_admin' => "You May Not Edit A Root Admin's Post.",
Save & Upload.

Edited by RuneCore, 27 November 2007 - 10:48 PM.

Posted Image
http://www.virtualdump.net
--------------
My Mods:
[RC23]Songs in Profiles / Demo
^Winner of the Best Medium Mod of October 2007 award on Invisionize
^Second place in the Semi-Annual Mod Competition
[RC23]Individual Member Adsense
^Winner of the Best Medium Mod of November 2007 award on Invisionize
[RC22]Messenger Icons in Topic View
[RC23]Banned Sig Replacement
More...

Posted Image

#6 sts

sts

    Novice

  • Members
  • PipPip
  • 10 posts
  • IPB Version:N/A

Posted 09 December 2007 - 11:39 PM

Great post!

Your solution was the only one which actually worked for me.
Thanks.

Edited by riven3d, 09 December 2007 - 11:50 PM.
removed quote


#7 DrAhmed

DrAhmed

    Advanced Member

  • Banned
  • PipPipPipPip
  • 86 posts
  • Location:Egypt
  • Real Name:ahmed
  • IPB Version:v2.3.x

Posted 22 April 2008 - 09:22 AM

Excellent Work

بنحبك يا زمالك وحنفضل نحبك مهما عملت فينا


#8 MaZaGanGY

MaZaGanGY

    Novice

  • Banned
  • PipPip
  • 18 posts
  • Real Name:Muhamed
  • IPB Version:v2.3.x

Posted 10 January 2009 - 01:51 PM

View PostRuneCore, on Nov 28 2007, 12:48 AM, said:

Calypso posted this on invisionize, but it would still show the buttons. Combined with mine, it should do exactly what you want:

Open: sources/classes/class_post_edit.php

Find:
		//-----------------------------------------
		// Load the old post
		//-----------------------------------------
		
		$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'posts', 'where' => "pid=".intval($this->ipsclass->input['p']) ) );
		$this->ipsclass->DB->simple_exec();
		
		$this->orig_post = $this->ipsclass->DB->fetch_row();
		
		if (! $this->orig_post['pid'])
		{
			$this->ipsclass->Error( array( LEVEL => 1, MSG => 'missing_files') );
		}
Add Below:
		if ( $this->ipsclass->member['mgroup'] != 4 )
		{

		$data = $this->ipsclass->DB->build_and_exec_query( array( 'select' => 'mgroup',
															   'from'   => 'members',
															   'where'  => 'id='.$this->orig_post['author_id'],
													  )		 );

		if ( $data['mgroup'] == 4 )
		{
			$this->ipsclass->Error( array( LEVEL => 1, MSG => 'root_admin') );
		}

		}
Save & Upload

Open: cache/lang_cache/en/lang_error.php

Find:
);

?>
Add Above:
'root_admin' => "You May Not Edit A Root Admin's Post.",
Save & Upload.
even this doesn't work :S




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users