Jump to content

Rotating Banner Stop Rotating When I Remove A Link.


Beeeeney

Recommended Posts

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Beeeeney
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :happy-04:

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.