gareth123456 Posted September 27, 2005 Posted September 27, 2005 I am currently using tradedoubler to try to generate some ad revenue, I am sure that this issue is the same for other advertisign programmes.... I have changed my code in footer.php to attempt to disable the display of banners when a user is viewing the website using SSL. The reason I need to do this is because the banners are fed non-secure and a user keeps getting warnings that there are non-secure elements. Using the code below causes non of my banners to show at all!! Any clues on why its not working?? <?php if ($banner = tep_banner_exists('dynamic', '468x60')) { if ($request_type == 'NONSSL') { ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"><?php echo tep_display_banner('static', $banner); ?></td> </tr> </table> <?php } } ?> Thanks Gareth
♥Monika in Germany Posted September 27, 2005 Posted September 27, 2005 I am currently using tradedoubler to try to generate some ad revenue, I am sure that this issue is the same for other advertisign programmes.... I have changed my code in footer.php to attempt to disable the display of banners when a user is viewing the website using SSL. The reason I need to do this is because the banners are fed non-secure and a user keeps getting warnings that there are non-secure elements. Using the code below causes non of my banners to show at all!! Any clues on why its not working?? <?php if ($banner = tep_banner_exists('dynamic', '468x60')) { if ($request_type == 'NONSSL') { ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"><?php echo tep_display_banner('static', $banner); ?></td> </tr> </table> <?php } } ?> Thanks Gareth Gareth the code looks ok to me ... you should do an echo for the request_type to see what it is. Can we have a link? :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
gareth123456 Posted September 28, 2005 Author Posted September 28, 2005 I'm going to try: ($request_type !='SSL') {include ( blah blah blah.......)} and see if that works - will let you know how I got on....
gareth123456 Posted September 28, 2005 Author Posted September 28, 2005 I changed the code in footer.php. Here is the full code (relating to the banner in the footer) <?php if ($request_type != 'SSL') { if ($banner = tep_banner_exists('dynamic', '468x60')) { ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"><?php echo tep_display_banner('static', $banner); ?></td> </tr> </table> <?php } } ?> and still the banner is not visable - even in non ssl mode. Any thought appreciated. I know that there are a couple of Banner contributions that will handle different ssl modes, but for the sake of just getting my &request_type statement set-up correctly, a full contribution seems like a sledge hammer to crack a nut!!!
♥Monika in Germany Posted September 28, 2005 Posted September 28, 2005 I changed the code in footer.php. Here is the full code (relating to the banner in the footer) <?php if ($request_type != 'SSL') { if ($banner = tep_banner_exists('dynamic', '468x60')) { ?> <br> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="center"><?php echo tep_display_banner('static', $banner); ?></td> </tr> </table> <?php } } ?> and still the banner is not visable - even in non ssl mode. Any thought appreciated. I know that there are a couple of Banner contributions that will handle different ssl modes, but for the sake of just getting my &request_type statement set-up correctly, a full contribution seems like a sledge hammer to crack a nut!!! without the outer if statement, the banner appers? can we see the behaviour? :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...
Guest Posted September 29, 2005 Posted September 29, 2005 Also check your popup blocker, I had the same problem I spend 2hrs trying to figure out why the code "wasnt working", and the same thing happened here when someone posted a banner link here asking questions about positioning and I was wondering :lol:
gareth123456 Posted October 3, 2005 Author Posted October 3, 2005 There is not alot to show.... without the outer if statement, the banners show (like they are ment to) if I add the outer statement nothing shows (no banner) in SSL or NON-SSL.... Can anyone suggest another way to get a banner to show in NON-SSL but disappear in SSL? I thought there was a way to do it with boxes (so some things would not show when you are checking out) could that be applied here?? Thanks Gareth
gareth123456 Posted October 3, 2005 Author Posted October 3, 2005 There is not alot to show.... without the outer if statement, the banners show (like they are ment to) if I add the outer statement nothing shows (no banner) in SSL or NON-SSL.... Can anyone suggest another way to get a banner to show in NON-SSL but disappear in SSL? I thought there was a way to do it with boxes (so some things would not show when you are checking out) could that be applied here?? Thanks Gareth Can I just add that if I change the first if statement to if (getenv('HTTPS') != 'on') the banner shows both in ssl and nonssl
Guest Posted October 3, 2005 Posted October 3, 2005 open your catalog\includes\application_top.php Find this line: $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL'; Replace it with this: $request_type = ($_SERVER['HTTPS'] == 'on') ? 'SSL' : 'NONSSL'; and retry with the original "if" statement you had
gareth123456 Posted October 3, 2005 Author Posted October 3, 2005 I changed application_top.php... and I then changed footer to: if ($request_type != 'SSL') and the banner shows in SSL and Non-SSL. However, If I change the if statement to if ($request_type == 'SSL') it dosnt show in SSL or Non-SSL mode. Its as thougth the statment controls if the banner shows or not, but can not switch between SSL and Non-SSL states or something..
Guest Posted October 3, 2005 Posted October 3, 2005 yes ok, if you know the secure port then try it for example: $_SERVER['SERVER_PORT']==443 instead of the previous $_SERVER['HTTPS'] == 'on'
gareth123456 Posted October 28, 2005 Author Posted October 28, 2005 Finally got it sorted. There was a problem with my ssl settings (application top.php) that was causing some elements of my site to be pulled from https rather than http. As a result my 'if ssl' code always saw something in ssl. That is sorted now and so I have changed the code in footer.php that calls my banner to: <?php if ($request_type != 'SSL') { if ($banner = tep_banner_exists('dynamic', '468x50')) { ?> As a result banners are visable when users are in non-secure mode and then when they check-out or go behind ssl, the banners dont show. Hope others find this useful. Gareth
Guest Posted November 24, 2005 Posted November 24, 2005 Also check your popup blocker, I had the same problem I spend 2hrs trying to figure out why the code "wasnt working", and the same thing happened here when someone posted a banner link here asking questions about positioning and I was wondering :lol: Mark, could I ask a question on this post - you've always been so helpful for me and I thought your comment may have something to do with my problem on my site. I have banner manager v1.4 installed and my site has a banner at the top, left column, and two on the right column. It looks fine on my browser and many many others I have testing it on. We have been live for a couple of months. Earlier tonight, I had a friend (who uses IE) tell me he could not see any of my banners????? I went over and tried for myself and it was true, however, if I tried to log on (whether sucessful or not) the banners suddenly appeared. Then, if I refreshed or logged off, or changed pages, they dissappeared again???? BIZAAR. Where they were info boxes in the side columns, the header of the box still displays but no banner. And I cannot recreate it on my machine, and I can't find anybody experiencing the same thing. I had another site that we put live a little over a month ago using the same contribution, and my friend with the problems on my site, could see the banners fine. Any ideas?????
Recommended Posts
Archived
This topic is now archived and is closed to further replies.