Beeeeney Posted October 11, 2012 Share Posted October 11, 2012 I have a small problem with my company's rotating banner. Our website is http://www.planetcruise.co.uk Basically, if I remove the link for the second banner, it stops rotating and doesn't let you view anything past that banner. Basically does anyone know how I can get it to display as a static image, rather than an image which requires a link? General code structure: $results = $search->getResults($dbh,'price','DESC',0,1000); shuffle($results->entries); $results->entries=array_slice($results->entries, 0, 6); ?> <!-- Start BODY section --> <div id="jsslider-container1"> <div class="ws_images"> <?php $i = 0; ?> <a href="#"><img src="http://planetcruise.co.uk/images/header/header_banner/Deals-Channel-banner-Oct-2012_Rev-B.gif" width="960" height="320" id="wows<?=++$i?>"/></a> Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/ Share on other sites More sharing options...
ManiacDan Posted October 11, 2012 Share Posted October 11, 2012 There is nothing in here that would rotate a banner. It's probably a javascript function. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384493 Share on other sites More sharing options...
Beeeeney Posted October 11, 2012 Author Share Posted October 11, 2012 I know the banner is JS, but I know literally nothing of JS and apparently I'm not allowed to know where that code is located, even though I have full FTP access. No worries, thanks. I'll let my manager know that it's a JS problem. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384496 Share on other sites More sharing options...
ManiacDan Posted October 11, 2012 Share Posted October 11, 2012 I didn't say it's definitely a JS problem, all I know is that you pasted me 6 completely random lines of code that don't do anything to banners or rotation. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384500 Share on other sites More sharing options...
Beeeeney Posted October 11, 2012 Author Share Posted October 11, 2012 (edited) I didn't say it's definitely a JS problem, all I know is that you pasted me 6 completely random lines of code that don't do anything to banners or rotation. Here's the code from the top of our index.php file down to where the second image code for the banner is. <?php $webroot=""; for ($i=0; $i<substr_count( str_replace("\\",'/',$_SERVER["SCRIPT_FILENAME"]), "/")-5;$i++){$webroot=$webroot."../"; } // Calculate Statistics $today = date('Y-m-d'); require_once $webroot."statistics/statistics.php"; $statistics = new statistics('banner'); $search = new OfferSearch(); $search->setSource('tourops'); if (isset($_GET['cruiseline'])){ $cl = $_GET['cruiseline']; if ($cl){$search->setCruiseline($cl);} }; ; if (isset($_GET['dest'])){$dest = $_GET['dest']; $search->setCruiseline($dest);}; $search->setStartdate(new ParameterRange(date("Y-m-d"), date("Y-m-d", mktime(0, 0, 0, date("m"),date("d")-1,date("Y")+2) ) ) ); //--------------------------number of offers displayed --------------------------------------- $results = $search->getResults($dbh,'price','DESC',0,1000); shuffle($results->entries); $results->entries=array_slice($results->entries, 0, 6); ?> <!-- Start BODY section --> <div id="jsslider-container1"> <div class="ws_images"> <?php $i = 0; ?> <!--<a href="http://www.planetcruise.co.uk/exclusive-offers/search/offers.php?ids=70421,112358,70418&title=KEEP%20IT%20SIMPLE%20WITH%20MSC%20CRUISES&bi=New-Template_MSC-Keepi-it-simple_May-2012_landing.gif"><img src="http://planetcruise.co.uk/images/header/header_banner/New-Template_MSC-Keepi-it-simple_May-2012.gif" width="960" height="320" id="wows<?//++$i?>"/></a>--> <a href="http://www.planetcruise.co.uk/cunard/queen-mary-2/africa/28-mar-2013/29-nights/34806/"><img src="http://planetcruise.co.uk/images/header/header_banner/cunarddeal.jpg" width="960" height="320" id="wows<?=$i?>"/></a> <a href="#"><img src="http://planetcruise.co.uk/images/header/header_banner/Deals-Channel-banner-Oct-2012_Rev-B.gif" width="960" height="320" id="wows<?=++$i?>"/></a> Edited October 11, 2012 by Beeeeney Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384509 Share on other sites More sharing options...
Jessica Posted October 11, 2012 Share Posted October 11, 2012 Do you know what javascript looks like at all? Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384510 Share on other sites More sharing options...
Beeeeney Posted October 11, 2012 Author Share Posted October 11, 2012 Do you know what javascript looks like at all? Yeah, I'm not a complete newbie with it. I learned the basic syntax right before I started learning PHP. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384511 Share on other sites More sharing options...
Jessica Posted October 11, 2012 Share Posted October 11, 2012 So, do you see ANY javascript in what you posted? I'm moving this to JS help btw. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384512 Share on other sites More sharing options...
Beeeeney Posted October 11, 2012 Author Share Posted October 11, 2012 So, do you see ANY javascript in what you posted? I'm moving this to JS help btw. No, there clearly is no JS in what I posted. I quite literally have no clue where the source of the problem is. That's why I posted the code from the page I edited, which in turn broke the banner. That seemed the most logical thing to post. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384514 Share on other sites More sharing options...
ManiacDan Posted October 11, 2012 Share Posted October 11, 2012 The source of the problem is most likely javascript. You can see the javascript in your browser by enabling firebug or developer tools, or you could just go find it in the filesystem since you have FTP access. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384519 Share on other sites More sharing options...
Beeeeney Posted October 11, 2012 Author Share Posted October 11, 2012 The source of the problem is most likely javascript. You can see the javascript in your browser by enabling firebug or developer tools, or you could just go find it in the filesystem since you have FTP access. I could, but I'd have no idea how to fix it. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384521 Share on other sites More sharing options...
ManiacDan Posted October 11, 2012 Share Posted October 11, 2012 Well good luck with that then. We can't help you fix your javascript by looking at random snippets of your PHP any more than we can help you fix your car by looking at pictures of your dog. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384526 Share on other sites More sharing options...
Beeeeney Posted October 11, 2012 Author Share Posted October 11, 2012 Well good luck with that then. We can't help you fix your javascript by looking at random snippets of your PHP any more than we can help you fix your car by looking at pictures of your dog. I know that, but I'm not allowed to use the JS file because I don't know JS. They don't want me to break their site, which is understandable. The devs are looking at it behind me as we speak. Thanks for the comments, anyway. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384527 Share on other sites More sharing options...
codefossa Posted October 12, 2012 Share Posted October 12, 2012 Wait ... They are allowing you to edit PHP, but not Javascript to avoid breaking their site? That's just plain stupid, and completely backwards. Also, there's tons of tutorials on how to rotate images in PHP, then link the page in an img tag. Even if you took that way, you would need to remove the rotation that's in JS, or you're gonna have them conflict, or have multiple banners. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1384684 Share on other sites More sharing options...
Beeeeney Posted October 15, 2012 Author Share Posted October 15, 2012 Wait ... They are allowing you to edit PHP, but not Javascript to avoid breaking their site? That's just plain stupid, and completely backwards. Also, there's tons of tutorials on how to rotate images in PHP, then link the page in an img tag. Even if you took that way, you would need to remove the rotation that's in JS, or you're gonna have them conflict, or have multiple banners. Because I know enough PHP to not break anything, but I don't know what I'm doing with JS. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1385259 Share on other sites More sharing options...
Adam Posted October 16, 2012 Share Posted October 16, 2012 Because I know enough PHP to not break anything, but I don't know what I'm doing with JS. That's what version control and code reviews were invented for. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1385520 Share on other sites More sharing options...
ManiacDan Posted October 16, 2012 Share Posted October 16, 2012 It seems very weird for a company to trust someone with a server-side language capable of deleting files, stealing database contents, entering into infinite loops, or destroying the memory usage of the server, but not trust that same person with client-size javascript which, at worst, will close a user's browser tab. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1385530 Share on other sites More sharing options...
Adam Posted October 16, 2012 Share Posted October 16, 2012 I'll be honest, I don't think even your managers know what they're doing. The Javascript on that site is all over the place. Also the supporting website of the plugin used for the carousel seems to have shut down. Perhaps it's time to upgrade to a new one? We're not here to fix old, unsupported plug-ins, even if you had shown the code. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1385532 Share on other sites More sharing options...
Beeeeney Posted October 16, 2012 Author Share Posted October 16, 2012 I'll be honest, I don't think even your managers know what they're doing. The Javascript on that site is all over the place. Also the supporting website of the plugin used for the carousel seems to have shut down. Perhaps it's time to upgrade to a new one? We're not here to fix old, unsupported plug-ins, even if you had shown the code. That site was built by someone who doesn't work here anymore. We currently have two contractors in the other room building a duplicate, with extra features and have been told to keep the code clean. If you saw the PHP for this website, you'd laugh uncontrollably. Quote Link to comment https://forums.phpfreaks.com/topic/269352-rotating-banner-stop-rotating-when-i-remove-a-link/#findComment-1385535 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.