Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Help with Merging PHP Code

Help with Merging PHP Code

Views: 2,017

Results 1 to 15 of 15
10 Mar 2015, 6:52 PM
#1
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Help with Merging PHP Code

I will be merging from "Responsive DIY Template Default for 1.5.x" plugin, to 12leaves "Abagon" Template, 5 pages total.
The instructions are > "Find all instances that look like this in the mentioned files:

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

CODE

<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

and copy it to {your template} files
However, some of the files don't have a BOF that fit that description so I'm not sure what to do. I'll start with tpl_box_default_left.php, entire page. This particular page is an example of a page that does not have "!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->". Some of the other pages have that.

I need to merge this from "Responsive DIY Template Default for 1.5.x"

<?php
/**
 * tpl_box_default_left.php
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_box_default_left.php 2975 2006-02-05 19:33:51Z birdbrain $
 * Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
 */

// choose box images based on box position
  if ($title_link) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
//
?>


<!--// 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; ?> //-->

With my Abagon Template

<?php
/**
* Template designed by 12leaves.com
* 12leaves.com - Free ecommerce templates and design services
*
* Common Template
* 
* @package languageDefines
* @copyright Copyright 2009-2010 12leaves.com
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_box_default_left.php 2975 2006-02-05 19:33:51Z birdbrain $
*/

// choose box images based on box position
  if ($title_link) {
    $title = $title . ' - <a href="' . zen_href_link($title_link) . '">' . BOX_HEADING_LINKS . '</a>';
  }
//
// #wel - category header style
  if ($box_id == "categories" || $box_id == "bestsellers") {
    $header_left = 'main-sidebox-header-left';
    $header_right = 'main-sidebox-header-right';
  } else {
    $header_left = '';
    $header_right = '';
  }
//
?>
<!--// 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; ?> //-->

Any help would be appreciated. Thanks

10 Mar 2015, 11:26 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with Merging PHP Code

Johnnycopilot:

I will be merging from "Responsive DIY Template Default for 1.5.x" plugin, to 12leaves "Abagon" Template, 5 pages total.
The instructions are
However, some of the files don't have a BOF that fit that description so I'm not sure what to do. I'll start with tpl_box_default_left.php, entire page. This particular page is an example of a page that does not have "!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->". Some of the other pages have that.

I need to merge this from "Responsive DIY Template Default for 1.5.x"

Modification of your Abagon Template file

<?php /** * Template designed by 12leaves.com * 12leaves.com - Free ecommerce templates and design services * * Common Template * * @package languageDefines * @copyright Copyright 2009-2010 12leaves.com * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: tpl_box_default_left.php 2975 2006-02-05 19:33:51Z birdbrain $ */ // choose box images based on box position if ($title_link) { $title = $title . ' - <a href="' . zen_href_link($title_link) . '">' . BOX_HEADING_LINKS . '</a>'; } // // #wel - category header style if ($box_id == "categories" || $box_id == "bestsellers") { $header_left = 'main-sidebox-header-left'; $header_right = 'main-sidebox-header-right'; } else { $header_left = ''; $header_right = ''; } // ?> <!--// 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; ?> //--> ``` > Any help would be appreciated. Thanks

removing:

<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>

Would be my basic guess/merge of the file and then take a look at the results within your template to see if still looks as desired... I'm not entirely sure what the above removed line does, but it does seem to impact the heading to some extent, so may still need to merge portions of it to get the desired result...

11 Mar 2015, 1:13 AM
#3
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

mc12345678, ok I think I get it. Tell me if this is it.. When I 'merge' the files, I want to take the code from the Responsive DIY, in every instance that has the same SAME BOF 'name' as my Abagon template, and replace EVERYTHING between the BOF and EOF with the [Responsive DIY code... and ADD any files that say <!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->?? For example

<!--// bof: <Anything here that is exact in both files> //-->

replace the code in my Abagon template that is HERE with the code in the Responsive DIY code, when the BOF name is the same in both files, no matter how much code, right?

And ADD

<!--// bof: <Anything here that is exact in both files> //-->

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
and ADD any code between these lines to existing abagon template file

<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

(Even though this particular file didn't have any <!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) files in it)

Is that correct?
Based on that, I can do the tpl_box_default_right.php because it's similar. But, I am running into a problem with the other 3 pages. They are
(tpl_main_page.php, tpl_footer.php, tpl_header.php)

since my instructions are "Find all instances that look like this in the mentioned files:

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

CODE

<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

and copy it to {your template} files

not sure exactly what do to here on the tpl_main_page.php page

"Responsive DIY Template Default for 1.5.x" tpl_main_page.php

<?php
/**
 * tpl_main_page.php
 *
 * Governs the overall layout of an entire page<br />
 * Normally consisting of a header, left side column. center column. right side column and footer<br />
 * For customizing, this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * - make a directory /templates/my_template/privacy<br />
 * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br />
 * <br />
 * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br />
 * to turn off the header and/or footer uncomment the lines below<br />
 * Note: header can be disabled in the tpl_header.php<br />
 * Note: footer can be disabled in the tpl_footer.php<br />
 * <br />
 * $flag_disable_header = true;<br />
 * $flag_disable_left = true;<br />
 * $flag_disable_right = true;<br />
 * $flag_disable_footer = true;<br />
 * <br />
 * // example to not display right column on main page when Always Show Categories is OFF<br />
 * <br />
 * if ($current_page_base == 'index' and $cPath == '') {<br />
 *  $flag_disable_right = true;<br />
 * }<br />
 * <br />
 * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br />
 * <br />
 * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br />
 *  $flag_disable_right = true;<br />
 * }<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_main_page.php 7085 2007-09-22 04:56:31Z ajeh $
 * Altered by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
 */

// the following IF statement can be duplicated/modified as needed to set additional flags
  if (in_array($current_page_base,explode(",",'shopping_cart')) ) {
    $flag_disable_right = true;
  }

  if (in_array($current_page_base,explode(",",'login')) ) {
    $flag_disable_right = true;
    $flag_disable_left = true;
  }

// (BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)
if ($flag_disable_right or COLUMN_RIGHT_STATUS == '0') {
$box_width_right = preg_replace('/[^0-9]/', '', '0'); 
$box_width_right_new = '';
}else{
$box_width_right = COLUMN_WIDTH_RIGHT;
$box_width_right = preg_replace('/[^0-9]/', '', $box_width_right); 
$box_width_right_new = 'col' . $box_width_right;
}

if ($flag_disable_left or COLUMN_LEFT_STATUS == '0') {
$box_width_left = preg_replace('/[^0-9]/', '', '0'); 
$box_width_left_new = '';
}else{
$box_width_left = COLUMN_WIDTH_LEFT;
$box_width_left = preg_replace('/[^0-9]/', '', $box_width_left); 
$box_width_left_new = 'col' . $box_width_left;
}

$side_columns_total = $box_width_left + $box_width_right;
$center_column = '970'; // This value should not be altered
$center_column_width = $center_column - $side_columns_total;
// (EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)

  $header_template = 'tpl_header.php';
  $footer_template = 'tpl_footer.php';
  $left_column_file = 'column_left.php';
  $right_column_file = 'column_right.php';
  $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
<?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<?php if (COLUMN_WIDTH == '0'){ ?>
<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<div id="mainWrapper">

<?php
 /**
  * prepares and displays header output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_header = true;
  }
  require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper">
  <tr>
<?php
if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_left
  $flag_disable_left = true;
}
if (!isset($flag_disable_left) || !$flag_disable_left) {
?>

 <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>">
<?php
 /**
  * prepares and displays left column sideboxes
  *
  */
?>
<div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td>
<?php
}
?>
<td valign="top">

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<?php }else{ ?>
<?php
 /**
  * prepares and displays header output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_header = true;
  }
  require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');

?>

<div class="onerow-fluid <?php echo $fluidisFixed; ?>">

<?php
if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_left
  $flag_disable_left = true;
}
if (!isset($flag_disable_left) || !$flag_disable_left) {
?>

<div class="<?php echo $box_width_left_new; ?>">

<?php
 /**
  * prepares and displays left column sideboxes
  *
  */
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?>
</div>

<?php
}
?>

<?php
 /**
  * decide center column width
  *
  */
 ?>

<div class="<?php echo 'col' . $center_column_width; ?>">

<?php } ?>
<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

<!-- bof  breadcrumb -->
<?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
    <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?>
<!-- eof breadcrumb -->

<?php
  if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

<!-- bof upload alerts -->
<?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?>
<!-- eof upload alerts -->

<?php
 /**
  * prepares and displays center column
  *
  */
 require($body_code); ?>

<?php
  if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<?php if (COLUMN_WIDTH == '0'){ ?>
<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
</td>

<?php
//if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' && $_SESSION['customers_authorization'] != 0)) {
if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_right
  $flag_disable_right = true;
}
if (!isset($flag_disable_right) || !$flag_disable_right) {
?>
<td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>">
<?php
 /**
  * prepares and displays right column sideboxes
  *
  */
?>
<div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td>
<?php
}
?>
  </tr>
</table>
<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<?php }else{ ?>
<br class="clearBoth" /> 
<br class="clearBoth" />
</div>


<?php
//if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' && $_SESSION['customers_authorization'] != 0)) {
if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_right
  $flag_disable_right = true;
}
if (!isset($flag_disable_right) || !$flag_disable_right) {
?>

<div class="<?php echo $box_width_right_new; ?>">

<?php
 /**
  * prepares and displays right column sideboxes
  *
  */
?>

<?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?>
</div>
<?php
}
?>
</div>
<?php } ?>
<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

<?php
 /**
  * prepares and displays footer output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_footer = true;
  }
	
	require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
?>

<!--bof- parse time display -->
<?php
  if (DISPLAY_PAGE_PARSE_TIME == 'true') {
?>
<div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div>
<?php
  }
?>
<!--eof- parse time display -->
<!--bof- banner #6 display -->
<?php
  if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>
<!--eof- banner #6 display -->
<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
<?php if (COLUMN_WIDTH == '0'){ ?>
</div><!--eof-->
<br class="clearBoth">
<?php }else{ ?>
<?php //do nothing ?>
<?php } ?>
<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->
</body>

Abagone tpl_main_page.php

<?php
/**
* Template designed by 12leaves.com
* 12leaves.com - Free ecommerce templates and design services
*
* Common Template
* 
* @package languageDefines
* @copyright Copyright 2009-2010 12leaves.com
* @copyright Copyright 2003-2007 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_main_page.php 7085 2007-09-22 04:56:31Z ajeh $
*/

// the following IF statement can be duplicated/modified as needed to set additional flags
  if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
  }


  $header_template = 'tpl_header.php';
  $footer_template = 'tpl_footer.php';
  $left_column_file = 'column_left.php';
  $right_column_file = 'column_right.php';
  $body_id = str_replace('_', '', $_GET['main_page']);

 // $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);


?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
<?php if (defined('SKINS_PANEL')) { require ('demo_panel.php'); }?>
<!--[if IE 6]>
<script type="text/javascript" src="gxbanner_template1014/transparent_png.js"></script>
<script type="text/javascript">
    DD_belatedPNG.fix('.page a, .center-upper-bg, .center-bottom-bg, .body-bg, .left_handle, .right_handle, .shadow_left, .shadow_right'); 
</script>
<![endif]-->

<div class="body-wrapper">
<div class="body-upper-bg">
<div class="body-bottom-bg">

<div class="clearBoth"></div>

<div id="header_bg">
	<div>

	<?php  require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

	</div>
</div>

<div class="body-bg">

<div class="mainWrapper">
<?php    	
 /**
  * prepares and displays header output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_header = true;
  }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper">
  <tr>
<?php
if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_left
  $flag_disable_left = true;
}
if ((!isset($flag_disable_left) || !$flag_disable_left)) {
?>

 <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>">
<?php
 /**
  * prepares and displays left column sideboxes
  *
  */
?>
<div class="float-left" id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td>
<?php } ?>

    <td id="columnCenter" valign="top">
<!-- bof  breadcrumb -->
<?php 
	if ((DEFINE_BREADCRUMB_STATUS == '1' || DEFINE_BREADCRUMB_STATUS == '2') && ($this_is_home_page != '1')) { ?>
    <div id="navBreadCrumb" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?>
<!-- eof breadcrumb -->


<!-- bof upload alerts -->
<?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?>
<!-- eof upload alerts -->
<?php
 /**
  * prepares and displays center column
  *
  */
 require($body_code); ?>

</td>

<?php
//if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' && $_SESSION['customers_authorization'] != 0)) { 
if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_right
  $flag_disable_right = true;
}
if ((!isset($flag_disable_right) || !$flag_disable_right)) {
?>
<td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>">
<?php
 /**
  * prepares and displays right column sideboxes
  *
  */
?>
<div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td>
<?php
}
?>
  </tr>
</table>

								       <br> 
</div>

</div>



<?php
 /**
  * prepares and displays footer output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_footer = true;
  }
  require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
?>

<!-- bof- parse time display -->
<?php
  if (DISPLAY_PAGE_PARSE_TIME == 'true') {
?>
<div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div>
<?php
  }
?>
<!-- eof- parse time display -->


</div>


</body>
11 Mar 2015, 1:24 AM
#4
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

TYPO near the top.. I didn't mean to put the "And ADD" just before the <!--// bof: <Anything here that is exact in both files> //--> I Screwed that all up. that was the EOF. My timer ran out when I was editing my post.. sorry
And ADD

<!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

and ADD any code between these lines to existing abagon template file

<!--(EOF - 2.1) Responsive DIY Template Default for 1.5.x (65)-->

(Even though this particular file didn't have any <!--(BOF - 2.1) Responsive DIY Template Default for 1.5.x (65) files in it)

11 Mar 2015, 2:00 AM
#5
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

Merging tpl_header.php's together is beyond my ability. I'm stuck on this one and the main_page (above post). Any help is GREATLY Appreciated
Here is the "Responsive DIY" tpl_header.php page

<?php
/**
 * Common Template - tpl_header.php
 *
 * this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * make a directory /templates/my_template/privacy<br />
 * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
 * to override the global settings and turn off the footer un-comment the following line:<br />
 * <br />
 * $flag_disable_header = true;<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2012 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: Ian Wilson  Tue Aug 14 14:56:11 2012 +0100 Modified in v1.5.1 $
 * Added by rbarbour (ZCAdditions.com), Responsive DIY Template Default for 1.5.x (65)
 */
?>

<?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_COMPAT, CHARSET, TRUE);
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
   echo htmlspecialchars($_GET['info_message'], ENT_COMPAT, CHARSET, TRUE);
} else {

}
?>


<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<?php
/**
 ******************************* BOF 2.1 **********************************
 */
?>
<div id="headerWrapper" class="<?php echo $fluidisFixed; ?>">
<?php
/**
 ******************************* EOF 2.1 **********************************
 */
?>
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
      } else {
        if (STORE_STATUS == '0') {
?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>

<?php

/**
 ******************************* BOF 2.1b **********************************
 */

if ($detect->isMobile() && !$detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') { ?>

<?php if (SHOW_GOTO_DESKTOP_FROM_MOBILE == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isDesktop') . '">' . ZCA_DESKTOP_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php if (SHOW_GOTO_TABLET_FROM_MOBILE == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isTablet') . '">' . ZCA_TABLET_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php } else if ($detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){ ?>

<?php if (SHOW_GOTO_MOBILE_FROM_TABLET == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isMobile') . '">' . ZCA_MOBILE_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php if (SHOW_GOTO_DESKTOP_FROM_TABLET == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isDesktop') . '">' . ZCA_DESKTOP_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php } else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){ ?>

<?php if (SHOW_GOTO_MOBILE_FROM_DESKTOP == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isMobile') . '">' . ZCA_MOBILE_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php if (SHOW_GOTO_TABLET_FROM_DESKTOP == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isTablet') . '">' . ZCA_TABLET_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php } else { ?>

<?php if (SHOW_GOTO_MOBILE_FROM_DESKTOP == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isMobile') . '">' . ZCA_MOBILE_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php if (SHOW_GOTO_TABLET_FROM_DESKTOP == 'true') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isTablet') . '">' . ZCA_TABLET_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php if (SHOW_GOTO_NONRESPONSIVE_FROM_DESKTOP == 'true') {
if ($_SESSION['display_mode']=='isNonResponsive') { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isResponsive') . '">' . ZCA_RESPONSIVE_LINK_TEXT . '</a></li>'; ?><?php } else { ?>
<li><a href="<?php echo zen_href_link($current_page_base, zen_get_all_get_params(array('display_mode')) . 'display_mode=isNonResponsive') . '">' . ZCA_NONRESPONSIVE_LINK_TEXT . '</a></li>'; ?><?php } ?>

<?php } ?>

<?php } 

/**
 ******************************* EOF 2.1b **********************************
 */

?>

</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->

<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline">

<!-- ******************** EXAMPLE FOR 2.1b********************  -->
<!-- BOF: Per File, Device Type Javascript  -->
<?php
/**
 * 2.0 utilizes php-mobile-detect, allows us to use different Javascript for different devices.
 */

if ($detect->isMobile() && !$detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $detect->isTablet() && $_SESSION['display_mode']=='isMobile' or $_SESSION['display_mode']=='isMobile') { ?>

<script type="text/javascript">
	    document.write('This must be a Mobile phone!')
	  </script>

<?php } else if ($detect->isTablet() && (empty($_SESSION['display_mode'])) or $detect->isMobile() && $_SESSION['display_mode']=='isTablet' or $detect->isTablet() && $_SESSION['display_mode']=='isTablet' or $_SESSION['display_mode']=='isTablet'){ ?>

	  <script type="text/javascript">
	    document.write('This must be a Tablet!')
	  </script>
		
<?php } else if ($detect->isMobile() && !$detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $detect->isTablet() && $_SESSION['display_mode']=='isDesktop' or $_SESSION['display_mode']=='isNonResponsive'){ ?>

	  <script type="text/javascript">
	    document.write('This must be a Non-Responsive Desktop!')
	  </script>

<?php } else { ?>

	  <script type="text/javascript">
	    document.write('This must be a Desktop!')
	  </script>

<?php } ?>
<br />
<!-- EOF: Per File, Device Type Javascript  -->
<!-- ******************** EXAMPLE FOR 2.1b********************  -->

<?php echo HEADER_SALES_TEXT;?>

</div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->

<!--eof-header logo and navigation display-->

<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->

<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<?php } ?>

and here is my Abagon template tpl_header.php

<?php
/**
* Template designed by 12leaves.com
* 12leaves.com - Free ecommerce templates and design services
*
* Common Template
* 
* @package languageDefines
* @copyright Copyright 2009-2010 12leaves.com
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
*/
 function fn_print_r()
{
    static $count = 0;
    $args = func_get_args();

    if (!empty($args)) {
        echo "<div align='left' style='font-family: Courier; font-size: 13px;'><pre>";
        foreach($args as $k => $v){
            echo "<b>Debug [$k/$count]:</b>";
            @ob_start();
            print_r($v);
            $bdata = @ob_get_contents()."\n";
            @ob_end_clean();
            echo htmlspecialchars($bdata);
        }
        echo "</pre></div>";
    }
    $count++;
}
?>

<?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 {
  }

// test if box should display
  $show_languages= true;

  if ($show_languages == true) {
    if (!isset($lng) || (isset($lng) && !is_object($lng))) {
      $lng = new language;
    }

    reset($lng->catalog_languages);
    $languages_array = array();
    $current_language = '';    
      while (list($key, $value) = each($lng->catalog_languages)) {
        $languages_array_popup[$key] = $value['name'];
      }
     
    foreach ($languages_array_popup as $k => $v){
        if ($k == $_SESSION['languages_code']) {
            $current_language = $v;
        }
    }
  }

?>

<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

<div id="headerWrapper">
    <div class="center-upper-bg centered-wrapper"></div>

    <div class="body-bg">
        <div class="header_wrapper">

	      <div class="header-tools">
	       <!--bof-branding display-->
                <div id="logoWrapper"><div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>';?></div>
                </div>
				<div class="float-right">
				<!--bof-header ezpage links-->
				<div class="topper-menu float-right">
				<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
				<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
				<?php } ?>
				</div>
				<!--eof-header ezpage links-->


	           <!-- Languages/currency -->
			   <div class="languages-wrapper">
			   
			   <div class="nav-languages float-right">
     
				<?php if (!isset($lng) || (isset($lng) && !is_object($lng))) {
					$lng = new language;
				}
         
				reset($lng->catalog_languages);

				if (count ($lng->catalog_languages) > 1){
         
					while (list($key, $value) = each($lng->catalog_languages)) {
						echo '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . zen_image(DIR_WS_LANGUAGES.$value['directory'].'/images/'.$value['image'], $value['name'], '', '', ' style="vertical-align:middle;"') . '</a> ';
					}
				}
				?>
				</div>  <!-- nav language -->
        
               <?php   
                  if (isset($currencies) && is_object($currencies) && count ($currencies->currencies) > 1){
               ?>
                  <div class="currency">
                  <?php require($template->get_template_dir('tpl_currency_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_currency_header.php'); ?>
                
                    <div id="currPopup" class="popup popup-win hidden">
                      <img id="close-pic" class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
                      <ul class="list-popup">
                        <?php foreach ($currencies_array_popup as $k=>$v) { ?>
                            <li><a href="<?php if ((stripos($_SERVER['REQUEST_URI'], '.php')) !== false ) echo $_SERVER['REQUEST_URI']; else echo '?'; ?><?php echo '&currency='.$k; ?>"><?php echo $v; ?></a></li>
                        <?php }?>
                      </ul>
                    </div>
                  </div>
               <?php
                } 
               ?>                  
		       </div>  
<div class="clearBoth"></div>			   
			   <div id="login_logout_section" class="float-right">
	            <!--login-->
	            <?php if ($_SESSION['customer_id']) { ?>
			             <?php echo(TOP_MENU_HELLO);?><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo ($_SESSION['customer_first_name'].' '.$_SESSION['customer_last_name']);?></a>
			             <span> | </span>
		              <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
	           <?php
	               } else {
	               if (STORE_STATUS == '0') {
	           ?>
		       <?php echo LOGIN_WELCOME; ?>
	               <a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>
		          <span> or </span>
		       <?php echo REGISTER_WELCOME; ?>
                  <span><a href="<?php echo zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_REGISTER; ?></a></span>
	           <?php } } ?>
               <!--/login-->	
	           </div>
			   
			   <div align="right" class="cart-header-wrapper">
					  <!-- header cart section -->
					  <table align="right" class="align-center cart-header">
						<tr>
						   <td>
							   <div class="hidden cart-dropdown-wrapper">
								  <div class="cart-tab-wrapper"><img src="<?php echo $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images')?>/spacer.gif" width="1" height="1" alt="" /></div>
							   </div>
						   </td>
						   <td>
								<?php require($template->get_template_dir('tpl_shopping_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_shopping_cart_header.php'); 
								echo $content;?>		
						   </td>
						</tr>
					</table>
				</div>
			   
			   </div>
			   <div class="clearBoth"></div>
			   <div class="main_menu_panel">
               <?php require($template->get_template_dir('tpl_top_nav.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_top_nav.php'); ?>
               <!--search-->
				<div class="search-header">
					   <?php require($template->get_template_dir('tpl_search_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_search_header.php');?>
					   <!--	<div class="advanced_search float-left">
							<a href="index.php?main_page=advanced_search"><?php/* echo HEADER_ADVANCED_SEARCH;*/ ?></a>
							</div>-->
				</div>
				<!--/search-->

          </div>
          <!--eof-branding display-->
	    </div>

          <!--bof-optional categories tabs navigation display-->
          <?php
            if (CATEGORIES_TABS_STATUS == '1') {
               require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); 
            } ?>
          <!--eof-optional categories tabs navigation display-->


<!--bof-banner #1 display -->
<?php
if ($this_is_home_page) {
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
}
?>
<!--eof-banner #1 display -->

      </div>
    </div>
</div>
<?php } ?>
<!--eof-header logo and navigation display-->  

Any help is GREATLY Appreciated. I have got to get my website mobile responsive. Thanks!!!

12 Mar 2015, 2:15 AM
#6
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

If I can get help merging tpl_main_page.php & tpl_header.php I'll be on the way to getting my site mobile responsive. I'm stuck. Thanks!!

12 Mar 2015, 10:26 AM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with Merging PHP Code

Johnnycopilot:

If I can get help merging tpl_main_page.php & tpl_header.php I'll be on the way to getting my site mobile responsive. I'm stuck. Thanks!!

So, thing is it's not a one-for-one replacement of everything between various bof/eof flags,it would probably be better to compare the provided file to a stock zc file of the version used to make the responsive template.

There are some aspects of the responsive template required for it to turn things on and off, but there are also aspects of your templated version to give it the look and positioning of your template. It is the differences between the default template and the responsive that give the responsive functionality, and it is the differences between the default template and your template that give your template... The differences need to be accumulated to provide both.

12 Mar 2015, 4:58 PM
#8
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

mc12345678:

it would probably be better to compare the provided file to a stock zc file of the version used to make the responsive template.
Thanks mc12345678. hmm.. To me, PHP looks like a bunch of unrecognizable digits placed one after the other. Because I don't know what the code is saying or trying to do, when it comes to code in the middle of a section or phrase, I'm stuck. I can't even make an Educated Guess. And there are too many variables for me to change, check, change, check, etc. because, among other things, there could be bad unintended consequences that I don't even see or notice. Would anyone here be willing to give it a shot? Google has said they are going to stop showing indexing results to people searching on mobile devices unless the sites are mobile friendly. If anybody wants to try and merge those 2 files for me, and I don't get the desired results, I would still appreciate it. I can always uninstall. I merged the footer myself with some guesswork, but these have even more variables.

13 Mar 2015, 4:21 PM
#9
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,843
Plugin Contributions:
0

Re: Help with Merging PHP Code

wouldn't it be easier to pick up the "Business Responsive" theme from 12leaves and tweek the stylesheet for the sames colors as the aBabon template? I put them side by side and that seems to me to be much easier than what your trying to do.....and yes, I realize it means spending some money on the additional template, but the total cost of both templates is far cheaper than the hourly cost to have someone crawl through and make the changes needed to get the current template responsive.

13 Mar 2015, 5:22 PM
#10
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Help with Merging PHP Code

Johnnycopilot:

I will be merging from "Responsive DIY Template Default for 1.5.x" plugin, to 12leaves "Abagon" Template, 5 pages total.

Any help would be appreciated. ThanksTo be honest, trying to walk someone through the process of merging these two files really requires the person helping to simply DO THE WORK.. You'd be better served doing as barco57 suggest in buying another template or simply paying someone (like mc12345678) to do the merging and move on or hoping someone will come along and do the work and post it here or continue to struggle through this with you in this support thread..

barco57:

wouldn't it be easier to pick up the "Business Responsive" theme from 12leaves and tweek the stylesheet for the sames colors as the aBabon template? I put them side by side and that seems to me to be much easier than what your trying to do.....and yes, I realize it means spending some money on the additional template, but the total cost of both templates is far cheaper than the hourly cost to have someone crawl through and make the changes needed to get the current template responsive.
nods in agreement:yes:

13 Mar 2015, 8:09 PM
#11
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

DivaVocals:

To be honest, trying to walk someone through the process of merging these two files really requires the person helping to simply DO THE WORK.. You'd be better served doing as barco57 suggest in buyihng another template or simply paying someone (like mc12345678) to do the merging and move on or hoping someone will come along and do the work and post it here or continue to struggle through this wit you in this support thread..
nods in agreement:yes:
Thanks mc12345678, barco57, and DivaVocals. What you say makes sense. Like Y'all said, my best bet is to use a responsive template. barco57, thanks for finding that Business Responsive one for me. I'm sure that if understood PHP better, I would have realized this after mc12345678 tried to explain the reasons. I have another thread that lead me to making this thread, and in the other thread everyone was telling me the same thing. I should have listened. It's like you said DivaVocals, I am going to "continue to struggle through this" trying to piecemeal a fix,,, oh, and drive everyone here in the ZC Forum crazy in the process. I'll get a responsive template. Hopefully someone going through the same thing I am going through can pick up something helpful to them from these posts. Thanks everyone, I REALLY appreciate the ZenCart forum.:cheers:

16 Mar 2015, 6:42 AM
#12
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

I ran across this tonight and posted this in my 'other' related post as well. I thought it only fair that I post this, for anyone who has been reading and/or following this thread. 12leaves has Mobile (only) Themes. They install in the root, and don't effect your current site. Their description of the Mobile Only themes is... "There is no duplicate content after you install our mobile theme. Only look and feel changes when you visit the site via mobile device, so all the settings, products and other content are exactly the same as you have for your regular desktop theme. It works as just you change your theme via admin area, but it automatically changes for mobile devices." I am more than likely going with a responsive template, but I wanted to share this in case this may work better for someone. http://blog.12leaves.com/2012/11/22/mobile-zen-cart-template/

16 Mar 2015, 7:08 AM
#13
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Help with Merging PHP Code

Johnnycopilot:

I ran across this tonight and posted this in my 'other' related post as well. I thought it only fair that I post this, for anyone who has been reading and/or following this thread. 12leaves has Mobile (only) Themes. They install in the root, and don't effect your current site. Their description of the Mobile Only themes is... "There is no duplicate content after you install our mobile theme. Only look and feel changes when you visit the site via mobile device, so all the settings, products and other content are exactly the same as you have for your regular desktop theme. It works as just you change your theme via admin area, but it automatically changes for mobile devices." I am more than likely going with a responsive template, but I wanted to share this in case this may work better for someone. http://blog.12leaves.com/2012/11/22/mobile-zen-cart-template/

and this is why a hybrid which includes some adaptive and responsive feature IMHO is the better way to go:

By the way, it is the main difference between just this mobile theme and our responsive themes. You do not need to re-install any modules for the responsive themes to get it worked on mobile devices as they use only CSS styles (not new template files) to look different on mobile and tablet devices.

16 Mar 2015, 1:57 PM
#14
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help with Merging PHP Code

I'm not 100% sure if this is the case, but I have seen templates that are "outside" the template override system that do not properly handle/address information that is presented in the uri because of not integrating with the index.php file. Again, not saying 12leaves doesn't properly integrate with the rest of ZC, but it does appear that implementation is outside the ZC standard design by not using the template override system. (This is based on the posted information, no additional research has been performed on this company or it's templates. It is also based on previous request to so integrate A template (unknown origin) into ZC to support all expected operation(s)).

16 Mar 2015, 6:30 PM
#15
johnnycopilot avatar

johnnycopilot

Zen Follower

Join Date:
Mar 2012
Posts:
325
Plugin Contributions:
0

Re: Help with Merging PHP Code

One more thing I ran across. Quote from Google "Google recognizes three different configurations for building mobile sites... Responsive web design, Dynamic serving, Separate URLs, ..... Responsive design is Google’s recommended design pattern." More information here https://developers.google.com/webmasters/mobile-sites/mobile-seo/overview/select-config?hl=en