Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

code help - open window with set window size


nukleuz9

Recommended Posts

Posted

how do i open a new window that is set to a specific pixel size. this is the code i have at the moment. do i need java and if so how would i write it

 

 

 

<?php

/*

$Id: default.php,v 1.20 2003/02/14 12:51:58 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

define('TEXT_MAIN', 'If you are new to the whole shopping online experience we offer a little guided tour of how to use our website, please visit our <a href="http://www.yourdomain.com/guided-tour.html"target="anotherWindowName",width=100,height=100><u>yourdomain.com guided tour</u></a> <br><br> Enjoy your shopping experience with yourdomain.com');

define('TABLE_HEADING_NEW_PRODUCTS', 'Featured Products');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

if ( ($category_depth == 'products') || ($HTTP_GET_VARS['manufacturers_id']) ) {

define('HEADING_TITLE', 'Let's See What Products We Have');

define('TABLE_HEADING_IMAGE', '');

define('TABLE_HEADING_MODEL', 'Model');

define('TABLE_HEADING_PRODUCTS', 'Product Name');

define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');

define('TABLE_HEADING_QUANTITY', 'Quantity');

define('TABLE_HEADING_PRICE', 'Price');

define('TABLE_HEADING_WEIGHT', 'Weight');

define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');

define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');

define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');

define('TEXT_SHOW', '<b>Show:</b>');

define('TEXT_BUY', 'Buy 1 '');

define('TEXT_NOW', '' now');

define('TEXT_ALL', 'All');

} elseif ($category_depth == 'top') {

define('HEADING_TITLE', 'What's New Here?');

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

}

?>

Posted

Hello,

 

i have a problem with JavaScripts.

I've added the following code in the text section of my site:

 

<a href="javascript:popUp('http://www.mysite.com/mypage.php')">Open New

Window</a>

 

And in the head section the following code:

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function popUp(URL) {

day = new Date();

id = day.getTime();

eval("page" + id + " = window.open(URL, '" + id + "',

'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=500,he
ight=500,left

= 262,top = 34');");

}

// End -->

</script>

 

But it don't work. I get this error:

 

Parse error: parse error in /home/www/oscommerce/includes/languages/german/kompati1.php on line 33

 

Line 33 is the line with the code i added in the text section.

 

And within this error my site is not wrapped. So is see "HEADING_TITLE" and so on, but not the content. What do i have to to, that tzhe JavaScript works?

 

THX

 

wkonline

 

P.S. Sorry for my bad english :)

Posted

Without looking at the surrounding code, it sounds like entered the first line in a php block.

 

Change it to:

?>

<a href="javascript:popUp('http://www.mysite.com/mypage.php')">Open New

Window</a>

<?php

 

That should help,

Rob

Posted

Hi,

 

thx for the answer!

 

It is not in the <?php section. It is in the define section

 

define('TEXT_INFORMATION', '



[some text] <a href="javascript:popUp('http://www.mysite.com/mypage.asp')">Open New

Window</a> [some text]');

 

Is it possible that i can't use the ' in the JavaScript? But what else can i use?

 

wkonline

Posted
Hi,

 

thx for the answer!

 

It is not in the <?php section. It is in the define section

 

define('TEXT_INFORMATION', '



[some text] <a href="javascript:popUp('http://www.mysite.com/mypage.asp')">Open New

Window</a> [some text]');

 

Is it possible that i can't use the ' in the JavaScript? But what else can i use?

 

 

wkonline

 

OK I see;

prepend all single quotes inside the outer quotes with a backslash.

 

Example:

define('TEXT_INFORMATION', '<a href="Javascript:popUp('http://www.mysite.com/mypage.asp')">blahblah</a>');

 

This way you tell the PHP processor to treat these as literal quote characters instead of end-of-string markers.

 

HTH,

Rob

Posted

thx it is working perfectly!

 

wkonline

Archived

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

×
×
  • Create New...