fronsky Posted March 7, 2009 Share Posted March 7, 2009 I've seen a site that uses a banner to redirect to the contact us content page. How can I achieve this? If I enter contact_us.php at the url within the banner it opens the whole site in a new frame with the contact us page. That not the correct way. Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 bump Link to comment Share on other sites More sharing options...
morehawes Posted March 8, 2009 Share Posted March 8, 2009 Please give more details - and some of your code as i'm not quiet sure about what you mean. Is a banner just an image or are you talking about the affiliate program? Joe Joe MacMan strikes again! Always backup first before listening to me! Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2009 Share Posted March 8, 2009 I've seen a site that uses a banner to redirect to the contact us content page. How can I achieve this? If I enter contact_us.php at the url within the banner it opens the whole site in a new frame with the contact us page. That not the correct way. Try looking in includes/functions/banner.php for this code: $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; Change _blank to _self and see if that works for you. Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 I'll look at the code. I have to check what the contri 'banner manager 1.5' did to this code. Banner Manager 1.5 contains an option for new window or not. I did set this option to 'not a new window' and in the url I typed 'contact_us.php'. Despite it comes woth the earlier mentioned new window. I'll report my findings soon. Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 This is the current code. // hzw extra wijziging banner 1.5 - small update if (tep_not_null($banner['banners_html_text'])) { $banner_string = $banner['banners_html_text']; } else { // WebMakers.com Added: Banner Manager if ( $banner['banners_open_new_windows'] =='1' ) { if ( substr($banner['banners_image'], -3, 3) == 'swf' ) { $size = getimagesize(DIR_WS_IMAGES . $banner['banners_image']); $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . mm_output_flash_movie( $banner['banners_title'], DIR_WS_IMAGES . $banner['banners_image'] , $size[0] , $size[1]) . '</a>'; } else { $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; } } else { if ( substr($banner['banners_image'], -3, 3) == 'swf' ) { $size = getimagesize(DIR_WS_IMAGES . $banner['banners_image']); $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . mm_output_flash_movie( $banner['banners_title'], DIR_WS_IMAGES . $banner['banners_image'] , $size[0] , $size[1]) . '</a>'; } else { // $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; } } } tep_update_banner_display_count($banner['banners_id']); return $banner_string; } //// Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2009 Share Posted March 8, 2009 I'll look at the code. I have to check what the contri 'banner manager 1.5' did to this code. Banner Manager 1.5 contains an option for new window or not. I did set this option to 'not a new window' and in the url I typed 'contact_us.php'. Despite it comes woth the earlier mentioned new window. I'll report my findings soon. Did you use the 19 Mar 08 version of this? http://addons.oscommerce.com/info/1816 Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 Correct. I sent my code in banner.php. Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2009 Share Posted March 8, 2009 Correct. I sent my code in banner.php. target="_blank" is forcing a new window. Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 Now I see. There is no difference in the if-else for new window check. I'll change and test. Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 ?? Doesn't make any difference. To be sure I changed the code in always _self for if and else branch. Checked the correct directory for banner.php. Could It have to do with the way the url is handled, when it is not linking to external site (http...)? Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 The code: // WebMakers.com Added: Banner Manager if ( $banner['banners_open_new_windows'] =='1' ) { if ( substr($banner['banners_image'], -3, 3) == 'swf' ) { $size = getimagesize(DIR_WS_IMAGES . $banner['banners_image']); $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">' . mm_output_flash_movie( $banner['banners_title'], DIR_WS_IMAGES . $banner['banners_image'] , $size[0] , $size[1]) . '</a>'; } else { $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; } } else { if ( substr($banner['banners_image'], -3, 3) == 'swf' ) { $size = getimagesize(DIR_WS_IMAGES . $banner['banners_image']); $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">' . mm_output_flash_movie( $banner['banners_title'], DIR_WS_IMAGES . $banner['banners_image'] , $size[0] , $size[1]) . '</a>'; } else { // $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; $banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>'; } } } Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2009 Share Posted March 8, 2009 I'll look at the code. I have to check what the contri 'banner manager 1.5' did to this code. Banner Manager 1.5 contains an option for new window or not. I did set this option to 'not a new window' and in the url I typed 'contact_us.php'. Despite it comes woth the earlier mentioned new window. I'll report my findings soon. What happens if you remove the target code from banner.php? Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 no change :-( Link to comment Share on other sites More sharing options...
fronsky Posted March 8, 2009 Author Share Posted March 8, 2009 It works !!!!!! I closed all explorer windows and started again. It looks like the change was ok, but the cache influenced the testing. Thanks very much for your support and finding the error in the banner script! Link to comment Share on other sites More sharing options...
Guest Posted March 8, 2009 Share Posted March 8, 2009 It works !!!!!! I closed all explorer windows and started again. It looks like the change was ok, but the cache influenced the testing. Thanks very much for your support and finding the error in the banner script! When testing code changes, liberal use of the f5 key is in order :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.