Icy Phoenix

     
 

Enable HTML Only For Admins ( & Mods ) [updated]

Enable HTML Only For Admins ( & Mods ) [updated]

Article
Reply with quote    Download Post  
Post Enable HTML Only For Admins ( & Mods ) [updated] 
 
Hello,

I was searching for something like that when I found ( after many searches ) this topic. As it was something I found useful, I thought it could be great to adapt it to the latest version of IP.
First of all, Thanks to the author, Zuker, for his mod. I just adapted his own mod ( wasn't difficult at all ).

Well that's just a little mod but I hope it will help some guys.

PS : I did not check the code of Zuker but it seems right because I tested it on my board with some other mods and I had nothing wrong.

Ps² : If someone could check if everything is right ( in the code ) and is secured, it would be fine, thx.

EDIT : I just modified a bit the code of Zuker : after some lessons in php, I just compiled his code to make it faster.

Changed :
Code: [Download] [Hide]
  1. #  
  2. #-----[ REPLACE BY ]--------------------------------------------  
  3. #  
  4. # If you want to allow only Administrators to use HTML on your board,  
  5. # find ( in the following part ) :  
  6. #      if ($userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD) && ( $is_auth['auth_mod'] ))  
  7. # and replace by :  
  8. #      if ($userdata['user_level'] == ADMIN) && ( $is_auth['auth_mod'] ))  
  9.  
  10. // Mod for ALLOW HTML to Admins and Moderators - This Mod esclude HTML code for Users and Anonymous - BEGIN  
  11.  
  12. if ($userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD) && ( $is_auth['auth_mod'] ))  
  13. {  
  14.      // Set toggles for various options  
  15.      if ( !$board_config['allow_html'] )  
  16.      {  
  17.          $html_on = 0;  
  18.      }  
  19.      else  
  20.      {  
  21.          $html_on = ( $submit || $refresh ) ? ( ( !empty($_POST['disable_html']) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );  
  22.      }  
  23. }  
  24. else  
  25. {  
  26.      if ( !$board_config['allow_html'] )  
  27.      {  
  28.          $html_on = ( $submit || $refresh ) ? ( ( !empty($_POST['disable_html']) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );  
  29.  
  30.      }  
  31.      else  
  32.      {  
  33.          $html_on = 0;    
  34.      }  
  35. }  
  36. // Mod for ALLOW HTML to Admins and Moderators - This Mod exlude HTML code for Users and Anonymous - END  


TO :
Code: [Download] [Hide]
  1. #  
  2. #-----[ REPLACE BY ]--------------------------------------------  
  3. #  
  4. # If you want to allow only Administrators to use HTML on your board,  
  5. # find ( in the following part ) :  
  6. #     $userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD)  
  7. # and replace by :  
  8. #     $userdata['user_level'] == ADMIN)  
  9.  
  10. // Set toggles for various options  
  11. // Mod for ALLOW HTML to Admins and Moderators - This Mod esclude HTML code for Users and Anonymous - BEGIN  
  12.      if ( !$board_config['allow_html'] )  
  13.      {  
  14.          $html_on = 0;  
  15.      }  
  16.      elseif ($userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD) && ( $is_auth['auth_mod'] ))  
  17.      {      
  18.          $html_on = ( $submit || $refresh ) ? ( ( !empty($_POST['disable_html']) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );  
  19.      }  
  20. // Mod for ALLOW HTML to Admins and Moderators - This Mod exlude HTML code for Users and Anonymous - END  


HTML for Admins.rar
Description: Mod HTML for Admins 
Download
Filename: HTML for Admins.rar
Filesize: 1.81 KB
Downloaded: 30 Time(s)




 
Yros - View user's profile Send private message  
Yros [ Thu 29 Oct, 2009 18:11 ]
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us


Enable HTML Only For Admins ( & Mods ) [updated]

Comments
Reply with quote    Download Post  
Post Re: Enable HTML Only For Admins ( & Mods ) [updated] 
 
Thanks, I will make things easier in the new package for those who wants to do this...



 
Mighty Gorgon - View user's profile Send private message  
Mighty Gorgon [ Mon 02 Nov, 2009 12:26 ]
Display posts from previous:    

HideWas this topic useful?

Post new topic  Reply to topic  Page 1 of 1
 
 




 

 

cron