
Re: Enabling Html For Administrator Only
I apologize me with everybody but I see this alone post in this moment.
Well: I have tried to resolve this problem limiting only the use of the code alone html to the Admins and the Moderators (These last solo in the sections in which Moderators result).
#
#-----[ OPEN ]--------------------------------------------------
#
posting.php
#
#-----[ FIND ]--------------------------------------------------
#
// Set toggles for various options
if ( !$board_config['allow_html'] )
{
$html_on = 0;
}
else
{
$html_on = ( $submit || $refresh ) ? ( ( !empty($_POST['disable_html']) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );
}
#
#-----[ REPLACE ]--------------------------------------------
#
// Mod for ALLOW HTML to Admins and Moderators - This Mod esclude HTML code for Users and Anonymous - BEGIN
if ($userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD) && ( $is_auth['auth_mod'] ))
{
// Set toggles for various options
if ( !$board_config['allow_html'] )
{
$html_on = 0;
}
else
{
$html_on = ( $submit || $refresh ) ? ( ( !empty($_POST['disable_html']) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );
}
}
else
{
if ( !$board_config['allow_html'] )
{
$html_on = ( $submit || $refresh ) ? ( ( !empty($_POST['disable_html']) ) ? 0 : true ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );
}
else
{
$html_on = 0;
}
}
// Mod for ALLOW HTML to Admins and Moderators - This Mod exlude HTML code for Users and Anonymous - END
If you look well in the code replaced I have used:
if ($userdata['user_level'] == ADMIN || ($userdata['user_level'] == MOD) && ( $is_auth['auth_mod'] ))
This trains Admins and Moderators to the use of the html. If you want that only the Admins can use the html you must change this line in:
if ($userdata['user_level'] == ADMIN) && ( $is_auth['auth_mod'] ))
Now: You must add the < table > button in Posting Body:
[--OPEN--]
forums/templates/templatexxx/bbcb_mg.tpl
[--FIND--]
<a href="javascript:BBChl()" ><img border="0" src="{BBCB_MG_IMG_PATH}spoil.gif" name="highlight" type="image" onMouseOver="helpline('highlight')" alt="{L_BBCB_MG_HIGHLIGHT}" title="{L_BBCB_MG_HIGHLIGHT}" /></a>
[-- AFTER ADD --]
<a href="javascript:BBCtable()"><img border="0" src="{BBCB_MG_IMG_PATH}table.gif" name="table" type="image" onMouseOver="helpline('table')" alt="{L_BBCB_MG_TABLE}" title="{L_BBCB_MG_TABLE}" /></a>
Now it needs to remove from all the users the possibility to be able to choose whether to use or I lead the code html in
Profile - Control Panel (It's only a matter not to see the function because, if it were also present and the Users choose "Yes" to use him/it, the Code won't work for the change effected in posting.php):
[--OPEN--]
forums/templates/templatexxx/profile_add_body.tpl
[--FIND--]
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_BBCODE}:</span></td>
<td class="row2">
<label><input type="radio" name="allowbbcode" value="1" {ALWAYS_ALLOW_BBCODE_YES} /><span class="gen"> {L_YES}</span></label>
<label><input type="radio" name="allowbbcode" value="0" {ALWAYS_ALLOW_BBCODE_NO} /><span class="gen"> {L_NO}</span></label>
</td>
</tr>
[-- REPLACE WITH --]
<!--
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_BBCODE}:</span></td>
<td class="row2">
<label><input type="radio" name="allowbbcode" value="1" {ALWAYS_ALLOW_BBCODE_YES} /><span class="gen"> {L_YES}</span></label>
<label><input type="radio" name="allowbbcode" value="0" {ALWAYS_ALLOW_BBCODE_NO} /><span class="gen"> {L_NO}</span></label>
</td>
</tr>
-->
Last Chage: Now it needs to remove from the Posting Body the possibility from the consumers to be able to choose whether to use or I lead the code html in a determined Post:
[-- OPEN --]
forums/templates/templatexxx/posting_body.tpl
[--FIND--]
<!-- BEGIN switch_html_checkbox -->
<label><input type="checkbox" name="disable_html" {S_HTML_CHECKED} /> {L_DISABLE_HTML}</label><br />
<!-- END switch_html_checkbox -->
[-- REPLACE WITH --]
<!--
<!-- BEGIN switch_html_checkbox -->
<label><input type="checkbox" name="disable_html" {S_HTML_CHECKED} /> {L_DISABLE_HTML}</label><br />
<!-- END switch_html_checkbox -->
-->
These are the changes that I have used for allowing the Admins and the Moderators to use the Code html. Shortly I want to try to use an Option in the
ACP to allow the selection of the Users Level for the use of this function.
I again apologize me if I have seen now only this Post.
Best Regards,
Gomesh.