EzPortal - Portal Software for Forums

EzPortal Forums => Support => Topic started by: thellie on August 02, 2010, 03:28:28 am

Title: hiding the block frame
Post by: thellie on August 02, 2010, 03:28:28 am
hi there,
APOLOGY - this was in the wrong forum for a while until i realised my mistake... (note to admin - it's still there as i can't delete or move it, and i can't report it to the moderator either...)

anyway... i've just installed ezportal, and am coming to terms with the setup - i like it, despite the headache the php block type gave me for a couple of hours :)

up to now i have used the ad management mod to insert ads/info around the site, but so that i can cut down on using width unnecessarily, i've put a vertical lefthand column ad into a ezblock...

...works as it should, but as it's an image-based add, i'd like to hide the frame block structure, so that the ad sits (or appears to) floating on the left... with the other lefthand ezblocks above and/or below it.

is this currently possible without recoding, or recoding very much? it would need to be on a 'per block' level...

maybe 2 or 3 choices:
1 frame on
2 frame off
3 frame off, title on...?

i'm running this locally so can't show you an up to date version, but the original site is below - the ad is the trekking ad...



EDIT: sorry, had another thought too... whether it's possible to enable scrolling and fixed depth of a box?
Title: Re: hiding the block frame
Post by: JohnR on August 06, 2010, 12:50:11 pm
Here is a hack that will allow block headers to be hidden in SMF2 (if you enter [hide] (with square brackets) BEFORE the block title then it will hide the header).   It also uses a drop shadow on header blocks and no shadow on headerless blocks (pretty obvious what you need to change to modify that behaviour)

File modified is /themes/default/EzPortal2.template.php around line 1430 (replace the section between Function ShowEzBlocks... and  ....   // Check the ezblock type):

Code: [Select]
function ShowEzBlocks($ezColumn)
global $context, $txt, $settings, $scripturl, $ezpSettings;


    echo '<table class="table_list" width="100%">';

foreach($ezColumn['blocks'] as $ezBlock)
// @@@ edit to NOT show header if the block title start with [hide]
if (strtolower(substr($ezBlock['customtitle'],0,6)) != '[hide]')
{ echo '
<tbody class="header">
<td class="catbg"><span class="left"></span>';
// Check if they can collapse the ezBlock
if ($ezBlock['can_collapse'])
//@@@ edited to align collapse icon in center vertically
echo ' <span style="float:right"><img src="' . $settings['images_url'] . '/' .( $ezBlock['IsCollapsed'] ? 'expand.gif' : 'collapse.gif' ). '" onclick="javacscript:EzToogle(\'block',$ezBlock['id_layout'],'\',',$ezBlock['id_layout'],',this,1)" alt="+-" style="margin-top:0.6em;"/></span>';
// Show icon
if (!empty($ezBlock['icon']))
echo '<img src="',$ezpSettings['ezp_url'],"icons/" . $ezBlock['icon'] . '" alt="" /> ';
// Show title of ezBlock
echo $ezBlock['customtitle'];
if (($context['ezportal_block_manager'] == 1 || $ezBlock['IsManager'] == 1) && empty($ezpSettings['ezp_hide_edit_delete']))
echo ' <a href="',$scripturl,'?action=ezportal;sa=editblock;block=',$ezBlock['id_layout'],'"><img src="',$ezpSettings['ezp_url'],'icons/page_white_edit.png" alt="',$txt['ezp_edit2'], '" /></a>
<a href="',$scripturl,'?action=ezportal;sa=deleteblock;block=',$ezBlock['id_layout'],'"><img src="',$ezpSettings['ezp_url'],'icons/plugin_delete.png" alt="',$txt['ezp_delete2'], '" /></a>';
echo '</td>
<tbody class="content" >
<tr class="windowbg2" style="border:0;">
<td id="block',$ezBlock['id_layout'],'" ',($ezBlock['IsCollapsed'] ? 'style="display:none"' : 'style="border-left:solid 4px lightgrey;border-bottom:solid 4px lightgrey;"'),'>
{ // block without header can't be collapsed and hasn;t got a shadow
echo '
<tbody class="content" >
<tr class="windowbg2" style="border:0;">
<td id="block',$ezBlock['id_layout'],'" >

// Check the ezblock type

NOTE: this is offered without support - you should NEVER attempt to modify source files without making a backup copy first OR if you aren't sure what you are doing!