Stop Users From Removing Profile Blocks

With phpFox v2.0.7 or lower users can remove blocks from their profile and there isn't a setting yet to stop them from doing this in case you want everyone to have all the blocks visible at all times.

You can modify the 2 template files from your AdminCP to hide the ability to remove blocks.

First, edit the Global Template "block.html.php". Open the file and look for and remove:

HTML:
{if isset($sDeleteBlock)}
	<div class="js_edit_header_bar js_edit_header_hover" style="display:none;">
		<a href="#" onclick="if (confirm('{phrase var='core.are_you_sure' phpfox_squote=true}')) {left_curly} $(this).parents('.block:first').remove(); $.ajaxCall('core.hideBlock', 'type_id={$sDeleteBlock}&block_id=' + $(this).parents('.block:first').attr('id')); {right_curly} return false;" title="{phrase var='core.remove_this_block'}">
			{img theme='misc/application_delete.png' alt='' class='v_middle'}
		</a>
	</div>
{/if}


Next, go to the module theme and edit the block "design.html.php". Look for and remove:
HTML:
{if isset($aBlocks)}
<li><a href="#block">{img theme='misc/shape_square_add.png' class='v_middle'} {phrase var='theme.blocks'}</a></li>
{/if}

Comments
Only verified clients can post comments on our community. If you have any questions feel free to contact us here.
macagoraga wrote at December 24, 2011, 3:44 pm
1 Vote

Hi,
any way for do this with v3 ?

I check block.html.php and the IF statement is different.
there is ELSE.
and {if true || isset($sDeleteBlock)}

I am not sure if I can delete this.

Can you post another similar article for v3?

Thanks

macagoraga
verve 8 media wrote at July 15, 2011, 12:12 am
0 Votes

Don't forget to clear your cache in the admincp at tools > maintenance > cache manager.

verve 8 media
Joseph Kibler wrote at March 5, 2011, 5:51 pm
0 Votes

Line 26 to 32 in block.html.php
Line 30-32 in design.html.php

Joseph Kibler
DanoD wrote at January 13, 2011, 6:35 am
0 Votes
thumbs_up Thanks. Works like a charm!
DanoD
layback wrote at January 12, 2011, 4:40 am
0 Votes

it did work for me. i had to hunt down the paths, but once i did it, the block delete button disappeared on both profile and dashboard

layback
roachclip.com wrote at January 11, 2011, 4:48 am
0 Votes

This doesn't actually work. Can somebody explain to me why?

I have edited these files exactly as described AND cleared my sites cache. Big surprise, you can STILL DELETE BLOCKS.

Please provide a real solution for this problem Raymond.

roachclip.com
layback wrote at January 10, 2011, 6:30 pm
0 Votes

Eventually found it after alot of searching :/

To help others..

the paths are:

theme/frontend/default/template/block.html.php

and

/module/theme/template/default/block/design.html.php

layback
layback wrote at January 10, 2011, 6:19 pm
0 Votes

Can somebody post the full path to these files, im looking around in the phpfox folder labyrinth on my server and cant find block.html.php or design.html.php

help Smile

layback
ClubUgly wrote at November 18, 2010, 12:16 pm
0 Votes

Is there a plugin for this instead or can we manually add a new setting in acp trigger on/off globally the function?

ClubUgly
Kreeper wrote at November 18, 2010, 5:28 am
0 Votes

DingoMan, i have removed both the codes, i can no longer remove any blocks in either profile or dashboard, i think this covers both profile and dashboard logged in as a test member

Last Update on November 18, 2010, 5:29 am by Creeper
Kreeper
DMAN wrote at January 3, 2011, 3:46 pm
0 Votes

It's all good now Creeper. Thanks!

DMAN
Displaying 1 to 10 of 11