Please help with errors after changing to HTTPS

Started by Sono, February 24, 2024, 11:15:21 PM

Previous topic - Next topic

Sono

I have just changed my forum to https, but there are some errors I cannot fix. This is one crucial:

<div align="center" style="margin-bottom:10px;overflow:hidden;" >


<script type="text/javascript">

/***********************************************
* Conveyor belt slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/


//Specify the slider's width (in pixels)
var sliderwidth="1100px"
//Specify the slider's height
var sliderheight="200px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=1
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''

leftrightslide[0]='<a href="https://itunes.apple.com/us/artist/faya-tess/276364137?at=10lRpA&ct=Congovibes_Faya_Tess_Special&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="_blank"><img src="https://congovibes.com/Advertisement/faya_tess_special.jpg"  border=1 height="200px" width="200px"></a>'

leftrightslide[1]='<a href="https://apple.co/3m5kDfd" target="_blank"><img src="https://congovibes.com/Advertisement/extravision.PNG"  border=1 height="200px" width="200px"></a>'


leftrightslide[2]='<a href="https://geo.music.apple.com/us/album/s%C3%A8ve/1478884072?at=10lRpA&ct=Congovibes_Zaiko_Seve&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="itunes_store"> <img src="https://congovibes.com/Advertisement/zaiko_seve.jpg"  border=1 height="200px" width="200px"></a>'

leftrightslide[3]='<a href="https://geo.music.apple.com/me/album/sissi-ngwema/1526438245?at=10lRpA&ct=Congovibes_Bozi_Acoustique&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="_blank"><img src="https://congovibes.com/Advertisement/bozi_acoustique.jpg"  border=1 height="200px" width="200px"></a>'

leftrightslide[4]='<a href="https://geo.music.apple.com/us/album/fiesta-dor/679798073?at=10lRpA&ct=Congovibes_Aurlus_Mabele_Fiesta&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="_blank"><img src="https://congovibes.com/Advertisement/aurlus_mabele_fiesta.jpg"  border=1 height="200px" width="200px"></a>'


leftrightslide[5]='<a href="https://geo.music.apple.com/us/album/the-best-of/id980417614?at=10lRpA&ct=Congovibes_Sam_Fan_Thomas&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="_blank"><img src="https://congovibes.com/Advertisement/samfanthomas_african_typic.jpg"  border=1 height="200px" width="200px"></a>'

leftrightslide[6]='<a href="https://geo.music.apple.com/us/album/best-of-monique-s%C3%A9ka/1466464944?at=10lRpA&ct=Congovibes_Monique_Seka_Best&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="_blank"><img src="https://congovibes.com/Advertisement/moniqueseka_best.jpg"  border=1 height="200px" width="200px"</a>'

leftrightslide[7]='<a href="https://geo.music.apple.com/us/album/g%C3%A9rant/1353372192?at=10lRpA&ct=Congovibes_Pepe_Kalle_Gerant&itscg=30200&itsct=toolbox_linkbuilder&ls=1&app=music" target="_blank"><img src="https://congovibes.com/Advertisement/pepe_kalle_gerant.jpg"  border=1 height="200px" width="200px"></a>'




//Specify gap between each image (use HTML):
var imagegap='<img src="https://congovibes.com/Advertisement/spacer.jpg"  />'

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=10


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px;border-radius:10px;">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}



function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>
</div>

This conveyor belt slideshow does not work. Originally, the image links in it were http. After the change to https, the slideshow still loaded, but the images were missing, there were only emptry frames displayed. Then I rewritten the code to https in all links, since then  the slideshow does not load at all.  I tried reverting to htt: links in the code, no empty frames loading any more either. I have this slideshow inserted into a Simple Portal block.

The other oddity is that I have another directory for other images, strangely those images are loaded even from the old http links. Their link have not been changed yet, still they load. When I click inspect, I can see in the code that their links are http, but there is also a notification: Current source: https bla bala. How is this possible?

Sir Osis of Liver

Depending on how you istalled the code, you may have to escape all single quotes -


                     //Specify the slider\'s images
                      var rightrightslideltr=new Array()
                      var finalslideltr=\'\'


The links I checked work.  You may have made a typo somewhere in the code.  Shouldn't make any difference to the slideshow if the external links are http or https, if they worked before they should work after.  Did you do anything to force https in the forum?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sono

Quote from: Sir Osis of Liver on February 25, 2024, 04:34:16 PMDepending on how you istalled the code, you may have to escape all single quotes -


                    //Specify the slider\'s images
                      var rightrightslideltr=new Array()
                      var finalslideltr=\'\'


The links I checked work.  You may have made a typo somewhere in the code.  Shouldn't make any difference to the slideshow if the external links are http or https, if they worked before they should work after.  Did you do anything to force https in the forum?


I know the slideshow should work no matter there is SSL or not, but it happened as written, as soon as I changed the code to https links, the belt itself started disappearing. Before that it worked, the empty frames without the images showed up.

I thought about having made a typo somewhere, but the original of the code is still available online, and that does not work either. The belt itself does not load either. That div where it is placed remains 0 px in height, as if nothing was there. Here is the link to that code: http://dynamicdrive.com/dynamicindex14/leftrightslide.htm

I tried insertin the original code to a Weebly test page, it worked as is. The images were missing, there were empty frames, but the belt was there and working, even after entering my image links it worked, and my images showed up. When I copied the same code to my forum code, it stopped working. Containing div was empty, 0 px in height.

I am not an inspection expert, but I managed to find something in the inspection window of the browser about this. First of all you can find this belt code on my frontpage here: congovibes.com.

Here is the place it should appear:


The tree of elements containing the problematic code are: <content_section> ..... ->...... <sp_header> ..... ->...... <sp_block>. The javascript is in the latter one.

And this is what the inspector reports for that part of the index.PHP code:

"Uncaught SyntaxError: Unexpected token '&'     index.php:310"
In that row you can find this line:

"var finalslide=&#39;&#39;"
Just to clarify again, the code now inserted to my page is the original from the link mentioned above. It is not what I posted in the first message here. And you see it doesn't work either, so I guess it is not a typo problem.

Arantor

Looks like something mangled your code. How exactly did you add it?

Sono

Quote from: Arantor on February 25, 2024, 08:58:43 PMLooks like something mangled your code. How exactly did you add it?

Well, meanwhile I double checked it, and I have just noticed the inserted and the presented codes are different indeed. As if there was some character misinterpretation thing going on. This is what is inserted by me to the forum code:

<script type="text/javascript">


//Specify the slider's width (in pixels)
var sliderwidth="300px"
//Specify the slider's height
var sliderheight="150px"
//Specify the slider's slide speed (larger is faster 1-10)
var slidespeed=3
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider's images
var leftrightslide=new Array()
var finalslide=''
leftrightslide[0]='<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>'
leftrightslide[1]='<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>'
leftrightslide[2]='<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>'
leftrightslide[3]='<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>'
leftrightslide[4]='<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>'

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
var actualwidth=''
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>


And this is what is presented when the page loads in the browser:



//Specify the slider&#39;s width (in pixels)
var sliderwidth="300px"
//Specify the slider&#39;s height
var sliderheight="150px"
//Specify the slider&#39;s slide speed (larger is faster 1-10)
var slidespeed=3
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider&#39;s images
var leftrightslide=new Array()
var finalslide=&#39;&#39;
leftrightslide[0]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[1]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[2]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[3]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[4]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide=&#39;<nobr>&#39;+leftrightslide.join(imagegap)+&#39;</nobr>&#39;
var iedom=document.all||document.getElementById
if (iedom)
document.write(&#39;<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">&#39;+leftrightslide+&#39;</span>&#39;)
var actualwidth=&#39;&#39;
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write(&#39;<table border="0" cellspacing="0" cellpadding="0"><td>&#39;)
if (iedom){
write(&#39;<div style="position:relative;width:&#39;+sliderwidth+&#39;;height:&#39;+sliderheight+&#39;;overflow:hidden">&#39;)
write(&#39;<div style="position:absolute;width:&#39;+sliderwidth+&#39;;height:&#39;+sliderheight+&#39;;background-color:&#39;+slidebgcolor+&#39;" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">&#39;)
write(&#39;<div id="test2" style="position:absolute;left:0px;top:0px"></div>&#39;)
write(&#39;<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>&#39;)
write(&#39;</div></div>&#39;)
}
else if (document.layers){
write(&#39;<ilayer width=&#39;+sliderwidth+&#39; height=&#39;+sliderheight+&#39; name="ns_slidemenu" bgColor=&#39;+slidebgcolor+&#39;>&#39;)
write(&#39;<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>&#39;)
write(&#39;<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>&#39;)
write(&#39;</ilayer>&#39;)
}
document.write(&#39;</td></table>&#39;)
}
}

That "&#39" part is repeated everywhere.

I inserted the code in the SimplePortal management panel. It looks like this:



The right sidebar visible on the frontpage is also a Simple Portal block, but as you see there there is no problem with the code.

Arantor

I'd replace all the single quotes with double quotes given whatever SP is doing here (which, btw, is almost certainly wrong)

Sono

Quote from: Arantor on February 26, 2024, 03:19:09 AMI'd replace all the single quotes with double quotes given whatever SP is doing here (which, btw, is almost certainly wrong)

I ask in its thread what might cause this. It has not been a problem until the SSL was installed.

Arantor

HTTPS isn't really relevant. You changed the script because the URLs were old and something in SP is causing the input to be overly sanitised in a way it wasn't before - but HTTPS doesn't cause a change of single quotes to their 039 form, that's either in SMF or SP.

Sir Osis of Liver

We're running two instances of it here wrapped in php with all single quotes escaped.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sono

Quote from: Arantor on February 26, 2024, 11:59:18 AMHTTPS isn't really relevant. You changed the script because the URLs were old and something in SP is causing the input to be overly sanitised in a way it wasn't before - but HTTPS doesn't cause a change of single quotes to their 039 form, that's either in SMF or SP.

I also have a clue about that it is not the fact of being HTTPS itself, but it is caused by something related to the change of address. For example there was a file to help interpreting characters on a http link, and now SP doesn't reach it. Don't know just guessing. But it is still a fact that it worked before, and after installing the SSL it didn't. Something happened.

Kindred

well, sure....  if you MANUALLY put http scripts, etc into your code, then switching to https would break that...

that has nothing to do with SMF itself though
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

This is a very old script (20+ years), updates and support ended long ago, but it still works if you treat it kindly.  Wasn't able to find a current script with same functionality.  If you mess with the code you're likely to break it.  You should go back to a clean version of the original script (still available here), and work forward from that.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sono

Quote from: Sir Osis of Liver on February 28, 2024, 12:32:19 PMThis is a very old script (20+ years), updates and support ended long ago, but it still works if you treat it kindly.  Wasn't able to find a current script with same functionality.  If you mess with the code you're likely to break it.  You should go back to a clean version of the original script (still available here), and work forward from that.


But this is what I indicated in my comments above. In the first post I referred to my "messed" code, but later on I inserted the original as well, and indicated that it does not work either. I take the original from the DynamicDrive website, insert it into a Weebly test page, it works, when I insert it into the SimplePortal block on my SMF forum it doesn't work. Because for some reason, the final, presented code is full of those &#39 characters. Something happens when I add the code to the SimplePortal panel and press the Submit button there, or during the process when the forum or Simple Portal scripts process the code that I inserted. And it is like that since I changed to HTTPS. Before that even my messed code worked. Now, none, not even the original. While, in case I test the code on Weebly, it works, both, even with the images from my site, from my hosting space.

Sono

#13
You can check it here, this is a separate html page I have just placed to the server, with the conveyor belt code, the original code from DinamicDrive, with my image:

https://congovibes.com/conveyorbelt4.html

It works.

When I add the same code to the Simple Portal block, nothing appears, and when I check the presented code in the inspector this is what I get:


//Specify the slider&#39;s width (in pixels)
var sliderwidth="300px"
//Specify the slider&#39;s height
var sliderheight="150px"
//Specify the slider&#39;s slide speed (larger is faster 1-10)
var slidespeed=3
//configure background color:
slidebgcolor="#EAEAEA"

//Specify the slider&#39;s images
var leftrightslide=new Array()
var finalslide=&#39;&#39;
leftrightslide[0]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[1]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[2]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[3]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;
leftrightslide[4]=&#39;<a href="http://"><img src="https://www.congovibes.com/Images/thierry.jpg" border=1></a>&#39;

//Specify gap between each image (use HTML):
var imagegap=" "

//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=5


////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed
leftrightslide=&#39;<nobr>&#39;+leftrightslide.join(imagegap)+&#39;</nobr>&#39;
var iedom=document.all||document.getElementById
if (iedom)
document.write(&#39;<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">&#39;+leftrightslide+&#39;</span>&#39;)
var actualwidth=&#39;&#39;
var cross_slide, ns_slide

function fillup(){
if (iedom){
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",30)
}
window.onload=fillup

function slideleft(){
if (iedom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+8))
ns_slide.left-=copyspeed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+8))
ns_slide2.left-=copyspeed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}


if (iedom||document.layers){
with (document){
document.write(&#39;<table border="0" cellspacing="0" cellpadding="0"><td>&#39;)
if (iedom){
write(&#39;<div style="position:relative;width:&#39;+sliderwidth+&#39;;height:&#39;+sliderheight+&#39;;overflow:hidden">&#39;)
write(&#39;<div style="position:absolute;width:&#39;+sliderwidth+&#39;;height:&#39;+sliderheight+&#39;;background-color:&#39;+slidebgcolor+&#39;" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">&#39;)
write(&#39;<div id="test2" style="position:absolute;left:0px;top:0px"></div>&#39;)
write(&#39;<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>&#39;)
write(&#39;</div></div>&#39;)
}
else if (document.layers){
write(&#39;<ilayer width=&#39;+sliderwidth+&#39; height=&#39;+sliderheight+&#39; name="ns_slidemenu" bgColor=&#39;+slidebgcolor+&#39;>&#39;)
write(&#39;<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>&#39;)
write(&#39;<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>&#39;)
write(&#39;</ilayer>&#39;)
}
document.write(&#39;</td></table>&#39;)
}
}

It is full of those &#39 characters. The images should appear on the frontpage but there is only empty space there:



It seems something is happening on the step when the forum is receiving the data from the database to be displayed on pageload. In the database, you can already see the code submitted by me full of those &#39 characters, but there are also a bunch of other strange characters as well. I guess it is some kind of characterset setting, that the database stores the code on its own way. When you check the presented code I get on pageload, most of those strange characters gone, the originals are restored, except for that &#39. That somehow stays in the presented code on pageload, not transformed back. This is what is stored in the database:

https://drive.google.com/file/d/1Ry1yf61uykKZPS4Xsv55RW3fC0V61lK2/view?usp=sharing

Arantor

And I already told you how to fix that, change all the single quotes to double quotes.

Sono

But how is it that it does not work with single quotes any more? I am just interested.

Sir Osis of Liver

Quote from: Sir Osis of Liver on February 25, 2024, 04:34:16 PMDepending on how you installed the code, you may have to escape all single quotes -


                     //Specify the slider\'s images
                      var rightrightslideltr=new Array()
                      var finalslideltr=\'\'



Quote from: Arantor on February 26, 2024, 03:19:09 AMI'd replace all the single quotes with double quotes given whatever SP is doing here (which, btw, is almost certainly wrong)

Either method should fix the problem.  For reasons unknown, SP is apparently running the html in a php echo statement, and php recognizes single quotes as delimiters, so the first ' it hits breaks the statement and crashes the code.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sono

Quote from: Sir Osis of Liver on February 29, 2024, 03:00:39 PM
Quote from: Sir Osis of Liver on February 25, 2024, 04:34:16 PMDepending on how you installed the code, you may have to escape all single quotes -


                     //Specify the slider\'s images
                      var rightrightslideltr=new Array()
                      var finalslideltr=\'\'



Quote from: Arantor on February 26, 2024, 03:19:09 AMI'd replace all the single quotes with double quotes given whatever SP is doing here (which, btw, is almost certainly wrong)

Either method should fix the problem.  For reasons unknown, SP is apparently running the html in a php echo statement, and php recognizes single quotes as delimiters, so the first ' it hits breaks the statement and crashes the code.


The only question is why it hasn't been a problem so far? What made it to be like that from one moment to the other when changing to https?





Sir Osis of Liver

Quote from: Arantor on February 26, 2024, 11:59:18 AMHTTPS isn't really relevant. You changed the script because the URLs were old and something in SP is causing the input to be overly sanitised in a way it wasn't before - but HTTPS doesn't cause a change of single quotes to their 039 form, that's either in SMF or SP.
You must have made an error when you edited http/https in the script.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

No, *I* didn't :P

But that's not the problem the OP is having. It's *provably* editing what he's doing - every time he saves it, it's saving the single quotes in escaped form, you wouldn't do that accidentally. Nor would HTTPS cause this, it's just not how that works.

Now, I'd going to suggest that if the change to HTTPS happened, maybe plugins were updated at the same time. Which would explain why it didn't do this before but is now, and why existing blocks are left alone but editing them changes them on saving.

Advertisement: