oscommerce 2,3,1 i want to show right column only index.php. i use 960 grid (24,12,6) default, center grid_12, columns grid_6. if there is no right column, center grid size become 18, calculating left column grid_6 and center grid_12. but if right column active than center grid become 12.
changing the line 1 with the code below, right column is seen in index.php. with this code right column removes in all the pages but the place of right column is empty. i mean center column still is grid_12.
_
i do not understand setGridContentWidth is defined in template_top and osc_template. how it becomes 12 or 18. the if else statements are not finished.
question
how can i say if index.php show default left column grid_6, center column grid_12 right_column grid_6. but if it is not index.php, show only left column and make center column gird_18.
if ($oscTemplate->hasBlocks('boxes_column_right')&&(strpos($SERVER['PHP_SELF'], 'index.php')) && (!isset($GET['manufacturers_id']) && (!$current_category_id))) {
template bottom
<?php
?>
</div> <!-- bodyContent //-->
<?php
if ($oscTemplate->hasBlocks('boxes_column_left')) {
?>
<div id="columnLeft" class="grid<?php echo $oscTemplate->getGridColumnWidth(); ?> pull<?php echo $oscTemplate->getGridContentWidth(); ?>">
<div><?php echo $oscTemplate->getBlocks('boxes_column_left'); ?></div>
</div>
<?php
}
//line 1
if ($oscTemplate->hasBlocks('boxes_column_right')) {
?>
<div id="columnRight" class="grid_<?php echo $oscTemplate->getGridColumnWidth(); ?>">
<div><?php echo $oscTemplate->getBlocks('boxes_column_right'); ?></div>
</div>
<?php
}
?>
</div>
<div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> ofh row_5"><?php require(DIR_WS_INCLUDES . 'footer.php'); ?></div>
</div>
</div><!-- bodyWrapper //-->
<?php echo $oscTemplate->getBlocks('footer_scripts'); ?>
<!--[if IE]>
<link href="css/ie_style.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if gt IE 7]>
<link href="css/ie8_style.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript" src="ext/js/imagepreloader.js"></script>
<script type="text/javascript">
preloadImages([
'images/wrapper_pic.png',
'images/wrapper_pic-act.png',
'images/wrapper_pic_border.gif',
'images/wrapper_pic_border-act.gif',
'images/bg_button.png',
'images/bg_button1_header.png',
'images/bg_button2_header.png',
'images/bg_button3_header.png',
'images/bg_button4_header.png',
'images/bg_button_header_rep.png',
'images/bg_button4_header_rep.png',
'images/bg_button_rep.png',
'images/menu_item.jpg',
'images/menu_item-act.gif']);
</script>
</body>
</html>
template top
<?php
$oscTemplate->buildBlocks();
if (!$oscTemplate->hasBlocks('boxes_column_left')) {
$oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
}
if (!$oscTemplate->hasBlocks('boxes_column_right')) {
$oscTemplate->setGridContentWidth($oscTemplate->getGridContentWidth() + $oscTemplate->getGridColumnWidth());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>><head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.6-osc.css" />
<script type="text/javascript" src="ext/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.6.min.js"></script>
<?php
if (tep_not_null(JQUERY_DATEPICKER_I18N_CODE)) {
?>
<script type="text/javascript" src="ext/jquery/ui/i18n/jquery.ui.datepicker-<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>.js"></script>
<script type="text/javascript">
$.datepicker.setDefaults($.datepicker.regional['<?php echo JQUERY_DATEPICKER_I18N_CODE; ?>']);
</script>
<?php
}
?>
<script type="text/javascript" src="ext/jquery/bxGallery/jquery.bxGallery.1.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />
<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="ext/jquery/jquery.equalheights.js"></script>
<script type="text/javascript" src="ext/js/coin-slider.js"></script>
<link rel="stylesheet" type="text/css" href="ext/960gs/<?php echo ((stripos(HTML_PARAMS, 'dir="rtl"') !== false) ? 'rtl_' : ''); ?>960_24_col.css" />
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="css/constants.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/style_boxes.css" />
<link rel="stylesheet" type="text/css" href="css/coin-slider-styles.css" />
<link rel="stylesheet" type="text/css" href="css/css3.css" />
<link rel="shortcut icon" href="favicon.ico" />
<script type="text/javascript" src="ext/js/js.js"></script>
<style type="text/css">
.menu li, .wrapper, .infoBoxWrapper .infoBoxHeading, .title-t, .box-padd { behavior:url(<?php echo DIR_WS_CATALOG. 'ext/pie/PIE.php'?>)}
</style>
<?php echo $oscTemplate->getBlocks('header_tags'); ?>
</head>
<body>
<div class="bg_body" id="bodyWrapper">
<div class="wrapper-padd">
<div class="ofh row_1">
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
</div>
<div class="ofh row_2">
<?php require(DIR_WS_INCLUDES . 'menu.php'); ?>
</div>
</div>
<div class="wrapper-padd wrapper">
<?php require(DIR_WS_INCLUDES . 'extra_row.php');?>
<div class="container_<?php echo $oscTemplate->getGridContainerWidth(); ?> ofh row_4">
<div id="bodyContent" class="grid_<?php echo $oscTemplate->getGridContentWidth(); ?> <?php echo ($oscTemplate->hasBlocks('boxes_column_left') ? 'push_' . $oscTemplate->getGridColumnWidth() : ''); ?>">
osc_template
<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
class oscTemplate {
var $title;
var $blocks = array();
var $grid_container_width = 24;
var $grid_content_width = 12;
var $_grid_column_width =6;
function oscTemplate() {
$this->_title = TITLE;
}
function setGridContainerWidth($width) {
$this->_grid_container_width = $width;
}
function getGridContainerWidth() {
return $this->_grid_container_width;
}
function setGridContentWidth($width) {
$this->_grid_content_width = $width;
}
function getGridContentWidth() {
return $this->_grid_content_width;
}
function setGridColumnWidth($width) {
$this->_grid_column_width = $width;
}
function getGridColumnWidth() {
return $this->_grid_column_width;
}
function setTitle($title) {
$this->_title = $title;
}
function getTitle() {
return $this->_title;
}
function addBlock($block, $group) {
$this->_blocks[$group][] = $block;
}
function hasBlocks($group) {
return (isset($this->_blocks[$group]) && !empty($this->_blocks[$group]));
}
function getBlocks($group) {
if ($this->hasBlocks($group)) {
return implode("\n", $this->_blocks[$group]);
}
}
function buildBlocks() {
global $language;
if ( defined('TEMPLATE_BLOCK_GROUPS') && tep_not_null(TEMPLATE_BLOCK_GROUPS) ) {
$tbgroups_array = explode(';', TEMPLATE_BLOCK_GROUPS);
foreach ($tbgroups_array as $group) {
$module_key = 'MODULE_' . strtoupper($group) . '_INSTALLED';
if ( defined($module_key) && tep_not_null(constant($module_key)) ) {
$modules_array = explode(';', constant($module_key));
foreach ( $modules_array as $module ) {
$class = substr($module, 0, strrpos($module, '.'));
if ( !class_exists($class) ) {
include(DIR_WS_LANGUAGES . $language . '/modules/' . $group . '/' . $module);
include(DIR_WS_MODULES . $group . '/' . $class . '.php');
}
$mb = new $class();
if ( $mb->isEnabled() ) {
$mb->execute();
}
}
}
}
}
}
}
?>