Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding non-OSC link to Infobox?


gillweb

Recommended Posts

I use a javascript to pop open a new window for things like that - you can add the following line into the list of links in the information.php box file:

 

"<A href="java script:NewWindow(' http://ww.bargainbones.com/links','Links',...gt;<br>" .

 

in my footer.php file I have the actual java script:

 

<?php

/*

$Id: footer.php,v 1.25 2002/10/29 22:51:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2001 osCommerce

 

Released under the GNU General Public License

*/

require(DIR_WS_INCLUDES . 'counter.php');

?>

<head>

<SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>

<!--

var win=null;

function NewWindow(mypage,myname,w,h,pos,infocus){

if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}

if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}

else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}

settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resiz

able=no";win=window.open(mypage,myname,settings);

win.focus();}

// -->

</script>

</head>

.....rest of footer.php.........

Link to comment
Share on other sites

  • 3 weeks later...

Hello from Mexico City !

I added the following code in information.php

 

"<a href="java script:NewWindow('http://www.oanda.com/convert/classic?user=in4energy〈=es','oanda','200','200','custom','front');">Convertidor de Monedas</a><br>" .

 

But, it doesn?t work, the front page show a "error on page" at botton line. Why it doesn?t work?

 

Thank for your advice.

Link to comment
Share on other sites

thanks, let me show you

 

1. Link was added ok, and show it in botton line the java sript code

java1.GIF

 

2. Clicking the link, diplay a message error: "error on page"

java2.GIF

 

3. Clicking the warning, display: "error expectet", code=0

 

What is the trouble?

Link to comment
Share on other sites

I think that means you did not paste javascript into header of the page...

 

Take a closer look at the provided code.

 

I would not do it in the footer.php though. Header.php would be my choice.

Link to comment
Share on other sites

I tried this and I am getting this error:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/dappasco/public_html/includes/boxes/information.php on line 26

 

What have I done wrong here?

Link to comment
Share on other sites

you mean using javascript instead of using html <a href= with target="_blank"?

 

because if you use html, the popup window will come up as the same size as the last window you viewed where as with javascript you can set the size of the popup window and not cover up your main window

Link to comment
Share on other sites

you mean using javascript instead of using html <a href= with target="_blank"?

 

because if you use html, the popup window will come up as the same size as the last window you viewed where as with javascript you can set the size of the popup window and not cover up your main window

 

Oh Ok, I see. It does make sense. If the customer insists in leaving your site at least keep your own in their face. You could also open a framed window with your logo at the top.

Steve

-------------------------

Link to comment
Share on other sites

exactly - thats what we do and use for pop up windows for the faq and online howto manuals, etc.

 

we popup a smaller sized window with our logo and information, it doesnt cover up the main store window and so they never lose us.... hopefully :wink:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...