Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need some help with the layout please


imaaxx

Recommended Posts

I would like to add this advanced search box right beside my header gif.

My header gif is align left and i would like to place the advanced search align right in the very top part of the header.

 

<?php

/*

$Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// check if the 'install' directory exists, and warn of its existence

if (WARN_INSTALL_EXISTENCE == 'true') {

if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {

$messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');

}

}

 

// check if the configure.php file is writeable

if (WARN_CONFIG_WRITEABLE == 'true') {

if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {

$messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');

}

}

 

// check if the session folder is writeable

if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {

if (STORE_SESSIONS == '') {

if (!is_dir(tep_session_save_path())) {

$messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');

} elseif (!is_writeable(tep_session_save_path())) {

$messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');

}

}

}

 

// check session.auto_start is disabled

if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {

if (ini_get('session.auto_start') == '1') {

$messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');

}

}

 

if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {

if (!is_dir(DIR_FS_DOWNLOAD)) {

$messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');

}

}

 

if ($messageStack->size('header') > 0) {

echo $messageStack->output('header');

}

?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr class="header">

<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'directory.gif', 'Directory.com') . '</a>'; ?></td>

</tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

<tr class="headerNavigation">

<td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>

<td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <!-- <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td> -->

</tr>

</table>

<?php

 

//

// START advanced search header script insertion

//

//

?>

<?php

 

if ( (!strstr($_SERVER['PHP_SELF'],'checkout.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and (!strstr($_SERVER['PHP_SELF'],'shopping_cart.php')) and (!strstr($_SERVER['PHP_SELF'],'advanced_search.php')) and !tep_session_is_registered('customer_id') ) {

?>

<table align="center" border="0" width="100%" cellspacing="0" cellpadding="1">

<tr>

<td align="center" class="headerNavigation">

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="infoBoxContents" valign="middle" colspan="0">

<?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get"') ?>

<table border="0" width="50%" cellspacing="0" cellpadding="1" align="center">

<tr>

<td class="infoBoxContents" valign="middle" colspan="3"> </td>

<td class="infoBoxContents" valign="middle" colspan="3"><?php echo tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+100) . 'px"') ?></td>

<td class="infoBoxContents" valign="top" colspan="3"> </td>

<td class="infoBoxContents" valign="middle" colspan="3"><?php echo BOX_ADVSEARCH_CAT ?></td>

<td class="infoBoxContents" valign="middle" colspan="3"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ADVSEARCH_ALLCAT)))) ?></td>

<td class="infoBoxContents" valign="top" colspan="3"> </td>

<td class="infoBoxContents" valign="middle" colspan="3"><center><?php echo tep_image_submit('button_search.gif', BOX_HEADING_ADVSEARCH); ?></center></td>

</form></tr>

<?php } ?>

<?php

//

// END advanced search header script insertion

//

 

if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerError">

<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>

</tr>

</table>

<?php

}

 

if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr class="headerInfo">

<td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>

</tr>

</table>

<?php

}

?>

 

The section in red named the advanced header i would like it to be aligned right in the very top next to my directory.gif... not where it is now.

 

I have tried to move many times now but I break my site every time I do it :(

 

could someone please show me the right way to add it to the top part of my header.

 

Much thanks

Link to comment
Share on other sites

I would like to add this advanced search box right beside my header gif.

My header gif is align left and i would like to place the advanced search align right in the very top part of the header.

 

<?php

/*

  $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

// check if the 'install' directory exists, and warn of its existence

  if (WARN_INSTALL_EXISTENCE == 'true') {

    if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {

      $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');

    }

  }

 

// check if the configure.php file is writeable

  if (WARN_CONFIG_WRITEABLE == 'true') {

    if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {

      $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');

    }

  }

 

// check if the session folder is writeable

  if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {

    if (STORE_SESSIONS == '') {

      if (!is_dir(tep_session_save_path())) {

        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');

      } elseif (!is_writeable(tep_session_save_path())) {

        $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');

      }

    }

  }

 

// check session.auto_start is disabled

  if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {

    if (ini_get('session.auto_start') == '1') {

      $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');

    }

  }

 

  if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {

    if (!is_dir(DIR_FS_DOWNLOAD)) {

      $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');

    }

  }

 

  if ($messageStack->size('header') > 0) {

    echo $messageStack->output('header');

  }

?>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

  <tr class="header">

    <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'directory.gif', 'Directory.com') . '</a>'; ?></td>

  </tr>

</table>

<table border="0" width="100%" cellspacing="0" cellpadding="1">

  <tr class="headerNavigation">

    <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>

    <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <!-- <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td> -->

  </tr>

</table>

<?php

 

//

// START  advanced search header  script insertion

//

//

?>

<?php

 

if ( (!strstr($_SERVER['PHP_SELF'],'checkout.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and (!strstr($_SERVER['PHP_SELF'],'shopping_cart.php')) and (!strstr($_SERVER['PHP_SELF'],'advanced_search.php')) and !tep_session_is_registered('customer_id') )  {

?>

<table align="center" border="0" width="100%" cellspacing="0" cellpadding="1">

  <tr>

    <td align="center" class="headerNavigation">

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="infoBoxContents" valign="middle" colspan="0">

  <?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get"') ?>

<table border="0" width="50%" cellspacing="0" cellpadding="1" align="center">

<tr>

<td class="infoBoxContents" valign="middle" colspan="3"> </td>

<td class="infoBoxContents" valign="middle" colspan="3"><?php echo tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+100) . 'px"')  ?></td>

<td class="infoBoxContents" valign="top" colspan="3"> </td>

<td class="infoBoxContents" valign="middle" colspan="3"><?php echo BOX_ADVSEARCH_CAT ?></td>

<td class="infoBoxContents" valign="middle" colspan="3"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ADVSEARCH_ALLCAT)))) ?></td>

<td class="infoBoxContents" valign="top" colspan="3"> </td>

<td class="infoBoxContents" valign="middle" colspan="3"><center><?php echo tep_image_submit('button_search.gif', BOX_HEADING_ADVSEARCH); ?></center></td>

</form></tr>

<?php } ?>

<?php

//

// END advanced search header script insertion

//

 

if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr class="headerError">

    <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>

  </tr>

</table>

<?php

  }

 

  if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr class="headerInfo">

    <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td>

  </tr>

</table>

<?php

  }

?>

 

The section in red named the advanced header i would like it to be aligned right in the very top next to my directory.gif... not where it is now.

 

I have tried to move many times now but I break my site every time I do it :(

 

could someone please show me the right way to add it to the top part of my header.

 

Much thanks

any ideas?

please .... help

Link to comment
Share on other sites

You don't need all that code, all that you have to do is to put the link to the advanced search feature, plus the image path, plus the closing </a> where you want it to go, along with the align=right tag.

 

Vger

Link to comment
Share on other sites

You don't need all that code, all that you have to do is to put the link to the advanced search feature, plus the image path, plus the closing </a> where you want it to go, along with the align=right tag.

 

Vger

Would you be able to show me I am a n00b still with OS and PHP.... this is my 1st cart and im learning tons .... I have been trying for days now and I break my site every time i try to edit it :(

 

:thumbsup: :thumbsup:

thanks in advnace

Link to comment
Share on other sites

but it is the advanced search with all catagories im after :)

 

:thumbsup:

Ok so i have done what you said to do :)

i am actually learning this :

<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
   <td valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'directory.gif', 'Directory.com') . '</a>'; ?></td>
 <td valign="middle" align="right"><?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get"') ?>
<td class="infoBoxContents" valign="middle" colspan="1"> </td>
<td class="infoBoxContents" valign="middle" colspan="1"><?php echo tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+1) . 'px"')  ?></td>
<td class="infoBoxContents" valign="middle" colspan="1"> </td>
<td class="infoBoxContents" valign="middle" colspan="1"><?php echo BOX_ADVSEARCH_CAT ?></td>
<td class="infoBoxContents" valign="middle" colspan="1"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ADVSEARCH_ALLCAT)))) ?></td>
<td class="infoBoxContents" valign="middle" colspan="1"> </td>
<td class="infoBoxContents" valign="middle" colspan="1"><left><?php echo tep_image_submit('button_search_small.gif', Search) . '</a>'; ?></td>
 </tr>
</table>

 

 

I have stripped all the code down to this and im very happy with the look i have now... here is my only problem..

The orig search button was very large so I made a new one and put it in location where the old search button was.... however the PHP is still making the space for the button at the same size as the old button?? How do i tell it to use this new much smaller button and not waste all the space?

 

Thanks again for all your help!!

 

its was the </a> that saved the day .....

Link to comment
Share on other sites

Ok so i have done what you said to do :)

i am actually learning this :

<table border="0" width="100%" cellspacing="0" cellpadding="0">
?<tr class="header">
? ?<td valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'directory.gif', 'Directory.com') . '</a>'; ?></td>
?<td valign="middle" align="right"><?php echo tep_draw_form('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get"') ?>
<td class="infoBoxContents" valign="middle" colspan="1"> </td>
<td class="infoBoxContents" valign="middle" colspan="1"><?php echo tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+1) . 'px"') ??></td>
<td class="infoBoxContents" valign="middle" colspan="1"> </td>
<td class="infoBoxContents" valign="middle" colspan="1"><?php echo BOX_ADVSEARCH_CAT ?></td>
<td class="infoBoxContents" valign="middle" colspan="1"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ADVSEARCH_ALLCAT)))) ?></td>
<td class="infoBoxContents" valign="middle" colspan="1"> </td>
<td class="infoBoxContents" valign="middle" colspan="1"><left><?php echo tep_image_submit('button_search_small.gif', Search) . '</a>'; ?></td>
?</tr>
</table>

I have stripped all the code down to this and im very happy with the look i have now... here is my only problem..

The orig search button was very large so I made a new one and put it in location where the old search button was.... however the PHP is still making the space for the button at the same size as the old button?? How do i tell it to use this new much smaller button and not waste all the space?

 

Thanks again for all your help!!

 

its was the </a> that saved the day .....

 

It would appear i sopke to soon.. the code is in place but does not read the data bank ?? i must have taken out soemthing i should not have :( can you have a look if you get a chance and see what i did wrong?

 

thanks Again

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...