chrometweaks.org

Whats a good iPage web hosting service?

Click Here To View All Answers...


Quick question... Whats a good iPage web hosting service? Many thanks for any answer or 2. Second question.. I'm trying to put a search box in the header just under the logo. I borrowed some code from the search infobox and kind of played with it a bit and added some more borrowed code in includes/classes/boxes.php..

It's searching, but there are a few formatting issues. Here's the code I added to boxes.php:.

 class searchBox extends tableBox {.

   function searchBox($contents) {.

     $this->table_parameters = 'class="searchBox"';.

     $this->tableBox($contents, true);.

   }.

 }.

And here is the code I added in header.php right above the breadcrumb cell:.

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

 <tr>.

   <td class="headerNavigation" valign="bottom">&nbsp;&nbsp;<?php.

 $search_box_contents = array();.

 $search_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),.

                              'align' => 'left',.

                              'text' => tep_draw_input_field('keywords', '', 'align="middle" size="10" maxlength="30" style="width: '(BOX_WIDTH-30)'px"')'&nbsp;&nbsp;'tep_hide_session_id()tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH));.

 new searchBox($search_box_contents);.

?>.

</td>.

   <td class="headerNavigation"></td>.

 </tr>.

The problems I am having are first of all, the cell does not want to span the width of the page (I am running Centershop, but I don't think this should matter at all). I have to add another blank cell next to it to make it look right. This is bad because I can't put a border around it easily..

Second, the "go" button and the text input box are aligned at the top and look bad. I can't get them to align at the middle. This is also a concern because I plan to put a "Search" graphic before the text box too. I need all three of them to be aligned, but I can't even get these two aligned right..

Sorry if I've made stupid mistakes in the code, I hardly know any php. I'm just borrowing code and then using trial and error..

Oh and I also added this to the stylesheet:.

.searchBox {.

 background: #555555;.

 border: 1px;.

 border-style: solid;.

 border-color: #000000;.

 border-spacing: 1px;.

}.

Here is the link to the page:.

Clicky..

Can someone please help me? Thanks...

Comments (110)

That's a good question. I'm not sure what is the right answer to your question. I'll do some research and get back to you if I discover an useful answer. You should email the people at iPage as they probably could help you..

Comment #1

This is all that should be required, just place the code inside a table or set of td tags and use align in the td.

<?php.

Echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');.

Echo '<strong>Search:</strong> 'tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 100px"')' 'tep_hide_session_id()tep_draw_hidden_field('search_in_description', '1')tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH);.

?>..

Comment #2

Heres the code I have successfully used on several sites..

<?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') ?>.

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

<tr>.

<td align="left" class="main"><font color="#FFFFFF"><b>Search: &nbsp;</b></font><?php echo tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 100px"')'&nbsp;'tep_hide_session_id() ?>.

</td>.

<td valign="middle"><INPUT type=hidden value=1 name=search_in_description><?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) ?></td>.

<td>&nbsp;&nbsp;&nbsp;</td>.

</tr>.

</table></form>..

Comment #3

Thanks guys. It's still not aligning though. Is the size defined somewhere? I'm thinking maybe the default image size is set somewhere and that's why it's not aigning right...

Comment #4

For some reason, when I use this code, the login box stops working. Whenever I try to log in, it goes to the advanced search page. Even if I click on the sign in button instead of just hitting enter...

Comment #5

Try using a close form tag at the end of the code..

<?php.

Echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');.

Echo '<strong>Search:</strong> 'tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 100px"')' 'tep_hide_session_id()tep_draw_hidden_field('search_in_description', '1')tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH);.

?>.

</form>..

Comment #6

Anyone know how to move the search box to the bottom of the categories box?..

Comment #7

Use the column controller contribution:.

Http://www.oscommerc...tributions,1009.

It's great for moving boxes around. If you would rather not install it, go to catalog/includes/column_left.php and find the code for the search box and move it wherever you want...

Comment #8

I'll try that, thanks..

Meanwhile, I have a tougher question. Anyone know how to put text in the textbox (for example "Enter search term here") and make so that when the person clicks once in the box, it highlights all the text?.

I know how to put the text in there, I just can't figure out the highlighting with one click bit..

Thanks...

Comment #9

Take a look at the search box on the bottom right of this site..

Http://www.latinterritory.com.

Is that what you are hoping to acheive?..

Comment #10

That's exactly it. Do you know how to do it?..

Comment #11

Use the following code:.

       <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') ?>.

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

               <tr>.

                       <td align="left" class="main"><input  onFocus="if (this.value == 'Search') { this.value='' }" onBlur="if(this.value==''){this.value = 'Search'}" value="Search" name="keywords" type="text" id="search" size="20" style="width: 100">.

</td>.

                       <td valign="middle"><INPUT type=hidden value=1.

                 name=search_in_description><?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) ?></td>.

               <td>&nbsp;&nbsp;&nbsp;</td>.

 </tr>.

               </table></form>..

Comment #12

That's perfect, thank you very much for your help...

Comment #13

I will check out the contribution. I was hesitant to install it I figured moving the code would be much faster..

I tried relocating the code...

But.

It places another search box below the categories box. I tried simply taking the "functional" search code (without the create box functions) and placing it with the categories code. I must not be putting it in the correct location, because it either gives errors or simply does nothing..

I was.

Hoping.

Someone had already done this and could save me a few steps.. but I guess I should just install the Box Manager contribution..

Thanks for your suggestions!..

Comment #14

If you're running a fresh install of OSCommerce, the new column controller package is very easy to install because you just overwrite the original files. Otherwise, you need to edit file by file. It's still pretty easy though...

Comment #15

I'm trying to put a search box in the header just under the logo. I borrowed some code from the search infobox and kind of played with it a bit and added some more borrowed code in includes/classes/boxes.php..

It's searching, but there are a few formatting issues. Here's the code I added to boxes.php:.

 class searchBox extends tableBox {.

   function searchBox($contents) {.

     $this->table_parameters = 'class="searchBox"';.

     $this->tableBox($contents, true);.

   }.

 }.

And here is the code I added in header.php right above the breadcrumb cell:.

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

 <tr>.

   <td class="headerNavigation" valign="bottom">&nbsp;&nbsp;<?php.

 $search_box_contents = array();.

 $search_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),.

                              'align' => 'left',.

                              'text' => tep_draw_input_field('keywords', '', 'align="middle" size="10" maxlength="30" style="width: '(BOX_WIDTH-30)'px"')'&nbsp;&nbsp;'tep_hide_session_id()tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH));.

 new searchBox($search_box_contents);.

?>.

</td>.

   <td class="headerNavigation"></td>.

 </tr>.

The problems I am having are first of all, the cell does not want to span the width of the page (I am running Centershop, but I don't think this should matter at all). I have to add another blank cell next to it to make it look right. This is bad because I can't put a border around it easily..

Second, the "go" button and the text input box are aligned at the top and look bad. I can't get them to align at the middle. This is also a concern because I plan to put a "Search" graphic before the text box too. I need all three of them to be aligned, but I can't even get these two aligned right..

Sorry if I've made stupid mistakes in the code, I hardly know any php. I'm just borrowing code and then using trial and error..

Oh and I also added this to the stylesheet:.

.searchBox {.

 background: #555555;.

 border: 1px;.

 border-style: solid;.

 border-color: #000000;.

 border-spacing: 1px;.

}.

Here is the link to the page:.

Clicky..

Can someone please help me? Thanks...

Comment #16

UPDATE:.

I put the search box in it's own table, and now it spans the whole width of the page. I still can't get it to line up right though...

Comment #17


This question was taken from a support group/message board and re-posted here so others can learn from it.