Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

moving a infobox to the header


billybrag

Recommended Posts

Posted

on my site here i wan to move the authors (manufacturers) box to the top left, wher at the moment i have paypal info, how do i even go about doing this?

 

any ideas are appreciated!

:)

thanks

"because it'll hurt more"- the greatest film of all time?

Posted

i have tried doing this twice and each time it has cocked up, so i am getting a little desperate

"because it'll hurt more"- the greatest film of all time?

Posted

Add this inside the <td></td> in your includes/header.php file that currently holds your Paypal info:

 

<table border="0" cellspacing="0" cellpadding="0">
?<tr class="header">
? <td>
<?php include(DIR_WS_BOXES . 'manufacturers.php')?></td>
?</tr>
</table>

 

Change the box name to whatever you named the authors box. The cellpadding and cellspacing, etc. can be changed as well, to tweak the display.

They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. ~ Benjamin Franklin, 1759. տլ

Posted

i tried adding that but it gave a parse error earlier in the code?

"because it'll hurt more"- the greatest film of all time?

Posted

actually it throws up an error in includes/boxes/manufacturers.php

 

( i havent renamed th info box btw)

"because it'll hurt more"- the greatest film of all time?

Posted

I saw the error message, but am a bit confused. Nothing should have been changed in the manufacturers.php file.

They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. ~ Benjamin Franklin, 1759. տլ

Posted

you can see the errors here

 

and that error occurs here in the code

 

line 20 =

 

$manufacturers_name = ((strlen($temp_var) > 28) ? substr($temp_var'], 0, 28) . '..' : $temp_var);

"because it'll hurt more"- the greatest film of all time?

Posted

Here is one of my test sites, where I tested the code I posted for you:

 

http://qualicraft.com/mtest/

 

I don't see anything wrong with line 20 of your code, but then, I'm no PHP expert either.

 

On edit: It looks like you have one too many ) in your code, or one too few (.

They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. ~ Benjamin Franklin, 1759. տլ

Posted

oh, bugger,

dont suppose you know why its throwing that error then do you?

 

my manufacturers.php is below

 

 

[/code]

<?php

/*

$Id: manufacturers.php,v 1.1.1.1 2003/09/18 19:04:50 wilt Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

$manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");

if ($number_of_rows = tep_db_num_rows($manufacturers_query)) {

?>

<!-- manufacturers //-->

<?php

$temp_var = 'Adams, Douglas & Lloyd John';

 

$manufacturers_name = ((strlen($temp_var) > 28) ? substr($temp_var'], 0, 28) . '..' : $temp_var);

 

echo $manufacturers_name;

?>

 

<?php

$boxHeading = BOX_HEADING_MANUFACTURERS;

$corner_left = 'square';

$corner_right = 'square';

 

if ($number_of_rows <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {

// Display a list

$boxContent = '';

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);

if (isset($HTTP_GET_VARS['manufacturers_id']) && ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers['manufacturers_id'])) $manufacturers_name = '<b>' . $manufacturers_name .'</b>';

$boxContent .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . $manufacturers_name . '</a><br>';

}

 

$boxContent = substr($boxContent, 0, -4);

 

} else {

// Display a drop-down

$manufacturers_array = array();

if (MAX_MANUFACTURERS_LIST < 2) {

$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);

}

 

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);

$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],

'text' => $manufacturers_name);

}

 

$boxContent = tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get');

$boxContent .= tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"');

$boxContent .= tep_hide_session_id();

$boxContent .= '</form>';

}

 

require(DIR_WS_TEMPLATES . TEMPLATENAME_BOX);

?>

 

<!-- manufacturers_eof //-->

<?php

}

?>

[/code]

"because it'll hurt more"- the greatest film of all time?

Posted

Try this:

 

$manufacturers_name = ((strlen($temp_var) > 28) ? substr(($temp_var), 0, 28) . '..' : $temp_var);

 

I can't test it fully because I haven't made the same modifications that you have, but I'm not getting parse errors with this.

They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. ~ Benjamin Franklin, 1759. տլ

Posted

i think the prob is that u don't have a normal osc set-up - so i think u are calling the box from the wrong place.

Your online success is Paramount.

Posted
yes, thankks

 

you clever sod you :)

LOL.

 

some of the authors names are obscured(due to length - you can increase the length of the authors box in the header file. change the td width, around the box, to fit.

Your online success is Paramount.

Archived

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

×
×
  • Create New...