Question: When merging files, where BOF's have the same description, do I REPLACE all of the existing code between the BOF's and EOF's with DIY code,, or add DIY code to the other code keeping all DIY code between BOF and EOF and keeping original code intact,, or add the entire DIY BOF thru EOF beginnings, code, and end of file, below the existing code, leaving the original code start to finish intact? (see first example)

I understand what I need to do and why I need to do it, but I'm not sure where to start and stop and exactly what to add and/or replace.

I don't want to say this is confusing to me, but because I don't know what the code is saying, it all looks like unrecognizable digits, one following the other. I do understand that BOF means beginning of file, and EOF means End of file... Sorry I'm having so much difficulty understanding what to do. I've never merged 2 php files together... I took these few examples (below) from the first two files I tried to merge and I don't know what to do. I haven't even looked at the rest of them. Thanks
Original Code...
PHP Code:
<!--// bof: <?php echo $box_id?> //-->
<div class="leftBoxContainer" id="<?php echo str_replace('_''-'$box_id ); ?>" style="width: <?php echo $column_width?>">
<div class="sidebox-header-left <?php echo $header_left?>"><h3 class="leftBoxHeading <?php echo $header_right?>" id="<?php echo str_replace('_''-'$box_id) . 'Heading'?>"><?php echo $title?></h3></div>
<?php echo $content?>
</div>
<!--// eof: <?php echo $box_id?> //-->
Code from DIY...
PHP Code:
<!--// bof: <?php echo $box_id?> //-->
<?php if (COLUMN_WIDTH == '0'){ ?>
<div class="leftBoxContainer" id="<?php echo str_replace('_''-'$box_id ); ?>" style="width: <?php echo $column_width?>">
<?php }else{ ?>
<div class="leftBoxContainer <?php echo $minWidthHide?>" id="<?php echo str_replace('_''-'$box_id ); ?>">
<?php ?>
<h3 class="leftBoxHeading" id="<?php echo str_replace('_''-'$box_id) . 'Heading'?>"><?php echo $title?></h3>
<?php echo $content?>
</div>
<!--// eof: <?php echo $box_id?> //-->
Or here, this is even more confusing to me..
My original Code..
PHP Code:
<div id="navSuppWrapper">
        <!--bof-navigation display -->
        <?php if (EZPAGES_STATUS_FOOTER == '1' or (EZPAGES_STATUS_FOOTER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE$_SERVER['REMOTE_ADDR'])))) { ?>
        <?php require($template->get_template_dir('tpl_ezpages_bar_footer.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_ezpages_bar_footer.php'); ?>
        <?php ?>
        <!--eof-navigation display -->
DIY code is
PHP Code:
<!--bof-navigation display -->
<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<div id="navSuppWrapper" class="<?php echo $fluidisFixed?>">
<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

<div id="navSupp">
<ul>
<li><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?></a></li>
<?php if (EZPAGES_STATUS_FOOTER == '1' or (EZPAGES_STATUS_FOOTER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE$_SERVER['REMOTE_ADDR'])))) { ?>
<li><?php require($template->get_template_dir('tpl_ezpages_bar_footer.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_ezpages_bar_footer.php'); ?></li>
<?php ?>
</ul>
</div>
</div>
<!--eof-navigation display -->

And here, there is a 4 word addition, in the MIDDLE of existing code
PHP Code:
ENT_COMPATCHARSETTRUE); 
Am I supposed to add that one line of code to my existing code? I don't understand php, so I could easily miss something or screw something up.
original code
PHP Code:
<?php
  
// Display all header alerts via messageStack:
  
if ($messageStack->size('header') > 0) {
    echo 
$messageStack->output('header');
  }
  if (isset(
$_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo 
htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset(
$_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo 
htmlspecialchars($_GET['info_message']);
} else {

}

?>

DIY code is here
PHP Code:
<?php
  
// Display all header alerts via messageStack:
  
if ($messageStack->size('header') > 0) {
    echo 
$messageStack->output('header');
  }
  if (isset(
$_GET['error_message']) && zen_not_null($_GET['error_message'])) {
  echo 
htmlspecialchars(urldecode($_GET['error_message']), ENT_COMPATCHARSETTRUE);
  }
  if (isset(
$_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo 
htmlspecialchars($_GET['info_message'], ENT_COMPATCHARSETTRUE);
} else {

}
?>