osCmax v2.5 User Manual
Results 1 to 4 of 4

Popup window upon clicking a hyperlinked banner

This is a discussion on Popup window upon clicking a hyperlinked banner within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi, I have made a new info box, and placed a bannner in it. I want it to be hyerlinked ...

      
  1. #1
    Active Member developer_x's Avatar
    Join Date
    Nov 2004
    Location
    Digital Infoway
    Posts
    109
    Rep Power
    0


    Default Popup window upon clicking a hyperlinked banner

    Hi,
    I have made a new info box, and placed a bannner in it. I want it to be hyerlinked through a popup window linked to another site.

    How can i embedd this javascript code into catalog/includes/boxes/my_box.php?

    <a href="http://chat.boldchat.com/chat/visitor.jsp?cdid=961164255" target="_blank" onClick="this.newWindow = window.open('http://chat.boldchat.com/chat/visitor.jsp?cdid=961164255&url=' + document.location, 'Chat', 'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=1,width=640,height=480'); this.newWindow.focus(); this.newWindow.opener = window;return false;"><img alt="Live chat by Boldchat" src="http://www.roseluggage.com/images/headbabe12.jpg" border="1"></a>


    I know where to embedd it:

    $info_box_contents[] = array('align' => 'center',
    'text' => '<a href="http://chat.boldchat.com/chat/visitor.jsp?cdid=961164255">' . tep_image (DIR_WS_IMAGES . 'headbabe12.jpg', 'LiveSales') . '</a>' );

    But I need to use the javascript coding in order to get a pop up window.

    Any help would be greatly appreciated.

    Regards,
    |rf@N

  2. #2
    Active Member
    Join Date
    Jun 2004
    Location
    Glued to Computer Chair
    Posts
    108
    Rep Power
    0


    Default RE: Popup window upon clicking a hyperlinked banner

    look at how the popup image for a large image is done...should be similar coding
    True Meaning of Lost: Building a web site without knowledge or skill

    True Meaning of Crazy: Building a web site anyhow

    The Net Results: Never needing a comb again

    www.MakeMeThis.com

  3. #3
    Active Member developer_x's Avatar
    Join Date
    Nov 2004
    Location
    Digital Infoway
    Posts
    109
    Rep Power
    0


    Default RE: Popup window upon clicking a hyperlinked banner

    Thanks for replying. I have done that. But it still doesn't work. I have to use this javascript code:

    <a href="http://chat.boldchat.com/chat/visitor.jsp?cdid=961164290" target="_blank" onClick="this.newWindow = window.open('http://chat.boldchat.com/chat/visitor.jsp?cdid=961164290&url=' + document.location, 'Chat', 'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=1,width=640,height=480'); this.newWindow.focus(); this.newWindow.opener = window;return false;"><img alt="Live chat by Boldchat" src="http://www.roseluggage.com/images/headbabe12.jpg" border="1"></a>
    so that someone clicks the image of a box 'live_salesperson.php", boldchat's live support opens up in a pop up window. The coding of live_salespersons.php is:

    <!-- specials //-->
    <tr>
    <td>
    <?php
    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_LIVE_SALESPERSONS);

    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LIVE_SALESPERSONS));

    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
    'text' => '<a href="http://chat.boldchat.com/chat/visitor.jsp?cdid=961164290">' . tep_image (DIR_WS_IMAGES . 'headbabe12.jpg', 'LiveSales') . '</a>' );

    new infoBox($info_box_contents);

    ?>
    </td>
    </tr>
    <!-- specials_eof //-->
    This works. But i need a popup window. I think my problem is that i have to correclty use javascript code with in the single quotes which are infront of 'text' => .
    Someone talked about quotes within quotes are not allowed.

    I tried this but doesn't work. Code is:

    <?php
    $info_box_contents = array();
    $info_box_contents[] = array('text' => BOX_HEADING_LIVE_SALESPERSONS);

    new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_LIVE_SALESPERSONS));

    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
    //'text' => '<a href="http://chat.boldchat.com/chat/visitor.jsp?cdid=961164290">' . tep_image (DIR_WS_IMAGES . 'headbabe12.jpg', 'LiveSales') . '</a>');
    'text' => ?>
    <script language="javascript"><!--
    document.write('<?php echo '<a href="javascriptopupWindow(\\\' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>' ?>');
    //--></script>
    <?php );
    new infoBox($info_box_contents);

    ?>
    I didn't copied the javascript function again. although it is there.
    Any suggestions?

    Regards,
    |rf@N

  4. #4
    Active Member developer_x's Avatar
    Join Date
    Nov 2004
    Location
    Digital Infoway
    Posts
    109
    Rep Power
    0


    Default RE: Popup window upon clicking a hyperlinked banner

    I had contacted a person who had done the popup window feature at her site. And she was clearly not willing to cooperate. It is really pathetic when people of the open soure don't share knowledge after getting help from the community themselves.
    It should not have taken this much time to fix this problem. All I needed to do was to add an extrabacks slash before a few single quotes. I repeat in order to embed the bold chat coding in to the single quotes of an associative array of php, you need to change a few ' to \' . My coding is given below:


    $info_box_contents[] = array('align' => 'center',
    'text' => '<a href="http://chat.boldchat.com/chat/visitor.jsp?cdid=961164290" target="_blank" onClick="this.newWindow = window.open(\'http://chat.boldchat.com/chat/visitor.jsp?cdid=961164290&url=\' + document.location, \'Chat\', \'toolbar=0,scrollbars=1,location=0,statusbar=0,me nubar=0,resizable=1,width=640,height=480\'); this.newWindow.focus(); this.newWindow.opener = window;return false;"> ' . tep_image (DIR_WS_IMAGES . 'banner_livesales.jpg', 'LiveSales') . '</a>');
    If you want to see it in action , visit the site where I used this code:

    www.roseluggage.com

    Regards,
    Irfan

Similar Threads

  1. Anyway to get a popup window from FCK editor??
    By Redeye_Joe in forum osCMax v2 Features Discussion
    Replies: 1
    Last Post: 03-07-2006, 12:00 PM
  2. how to make popup window scrolling?
    By technoboy in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 02-08-2006, 11:26 AM
  3. Scrollable popup window
    By fuzzyphil in forum osCMax v1.7 General Mods Discussion
    Replies: 0
    Last Post: 10-10-2005, 03:39 AM
  4. Help changing text in popup window titlebar
    By groggory in forum osCmax v1.7 Discussion
    Replies: 4
    Last Post: 12-08-2004, 09:08 AM
  5. popup window too small
    By jlee in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 02-18-2003, 12:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •