TinyPortal

Development => Support => Installation => Topic started by: ClickSafe on January 30, 2012, 02:57:01 PM

Title: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on January 30, 2012, 02:57:01 PM
When i add the Google Ads code to Tiny Portal (html code), it saves in a strange way:
I ADD:
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXXXX";
/* forumonder */
google_ad_slot = "3643026077";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>


When i look to the code again i see next:
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXXXXXX";
/* forumonder */
google_ad_slot = "3643026077";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<ins style="display:inline-table;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px">
<ins id="aswift_0_anchor" style="display:block;border:none;height:90px;margin:0;padding:0;position:relative;visibility:visible;width:728px"><iframe allowtransparency="true" frameborder="0" height="90" hspace="0" marginwidth="0" marginheight="0" onload="var i="this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){i+='.call';setTimeout(h,0)}else" if(h.match){i+='.nav';w.location.replace(h)}s.log&amp;&amp;s.log.push(i)}" scrolling="no" vspace="0" width="728" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;"></iframe></ins></ins></center>

I use last release from SMF and Tiny Portal
Thanks in advance  ;)
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: Lesmond on January 30, 2012, 03:35:59 PM
What sort of block did you use? it should be an html/script block without using the WYSIWYG editor.

Please read the Posting Guidelines (http://www.tinyportal.net/index.php?topic=581)
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on January 30, 2012, 05:28:42 PM
Thank you for your quick response  ;)
I have used the correct block and used the HTML button to enter HTML code.
Here another 2 situations, 1 correct and 1 with the same result ...
CORRECT saving:
<center><span style="font-size: x-small">Volg het <strong>meeste recente medisch nieuws</strong> op onze scoop.it </span><span style="font-size: xx-small">(klik op een item, scroller blijft bij een mouse-over gewoon staan)<br />
</span><iframe height="200" src="http://www.scoop.it/t/gezondheid-chronische-pijn/js?format=rect&amp;;numberOfPosts=10&amp;;title=Gezondheid%20%26%20Chronische%20pijn&amp;;speed=5&amp;;mode=normal&amp;;width=345" frameborder="0" width="345" scrolling="no" align="middle"></iframe></center>


INCORRECT SAVING:
<center><embed width="130" height="130" src="/relog.swf?ggh=&amp;gid=&amp;&amp;ggm=&amp;rnd=&amp;gha=&amp;fna=&amp;ghb=&amp;ghf=&amp;gbc=&amp;gfc=&gt;c=&amp;gnu=" allowscriptaccess="always" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></object></center>

SAVED AS:
<center>
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="130" height="130">
<param name="_cx" value="3439">
<param name="_cy" value="3439">
<param name="FlashVars" value="">
<param name="Movie" value="/relog.swf?ggh=&amp;gid=&amp;&amp;ggm=&amp;rnd=&amp;gha=&amp;fna=&amp;ghb=&amp;ghf=&amp;gbc=&amp;gfc=&amp;gtc=&amp;gnu=">
<param name="Src" value="/relog.swf?ggh=&amp;gid=&amp;&amp;ggm=&amp;rnd=&amp;gha=&amp;fna=&amp;ghb=&amp;ghf=&amp;gbc=&amp;gfc=&amp;gtc=&amp;gnu=">
<param name="WMode" value="Transparent">
<param name="Play" value="-1">
<param name="Loop" value="-1">
<param name="Quality" value="High">
<param name="SAlign" value="">
<param name="Menu" value="-1">
<param name="Base" value="">
<param name="AllowScriptAccess" value="always">
<param name="Scale" value="ShowAll">
<param name="DeviceFont" value="0">
<param name="EmbedMovie" value="0">
<param name="BGColor" value="">
<param name="SWRemote" value="">
<param name="MovieData" value="">
<param name="SeamlessTabbing" value="1">
<param name="Profile" value="0">
<param name="ProfileAddress" value="">
<param name="ProfilePort" value="0">
<param name="AllowNetworking" value="all">
<param name="AllowFullScreen" value="false">
   
<embed width="130" height="130" src="/relog.swf?ggh=&amp;gid=&amp;&amp;ggm=&amp;rnd=&amp;gha=&amp;fna=&amp;ghb=&amp;ghf=&amp;gbc=&amp;gfc=&gt;c=&amp;gnu=" allowscriptaccess="always" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></object></center>


AND ANOTHER CORRECT SAVING:
<iframe height="250" src="http://www.scoop.it/t/gezondheid-chronische-pijn/js?format=square&amp;numberOfPosts=10&amp;title=Gezondheid%20%26%20Chronische%20pijn&amp;speed=3&amp;mode=normal&amp;width=155" frameborder="0" width="155" scrolling="no" align="middle"></iframe>

Seems to be very strange that some code is stored 100% and other code is saved with extra text ...
However the block are working, but still it's something whats going wrong ...
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on January 30, 2012, 05:34:38 PM
Sorry to reply so soon, but i just find out that the Google Ads code goes wrong on different sites/servers.
I have 2 different accounts by 2 different hosting company's and if i enter the Google ads code, it goes by both wrong.
THIS line is causes the problem:
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

And if i analyse it, it's because there is no > after: <script type="text/javascript"
If i put there an > then it saves like i typed it ... (but then the code does not work  :-X , whats normal)
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on January 31, 2012, 12:45:21 PM
I have changed languages to standard non UTF8, but no result, this error remains...
Even standard English does not change anything.
I suppose its some minor issue in Tiny Portal, by saving HTML and using < or >.
Strange thing is using next code = OK:
<div style="color:red;" align="center">abc</div>
And this code not:
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

;)
I found where the problem is, but do not know how to solve it:
THIS works OK: (the file showads.js is NOT real)
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/showads.js">
</script>

THIS NOT: the file show_ads.js is REAL and will be executed
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


And i supose that this is the code from: show_ads.js, that's WHY it's added
<iframe allowtransparency="true" frameborder="0" height="90" hspace="0" marginwidth="0" marginheight="0" onload="var i="this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){i+='.call';setTimeout(h,0)}else" if(h.match){i+='.nav';w.location.replace(h)}s.log&amp;&amp;s.log.push(i)}" scrolling="no" vspace="0" width="728" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;"></iframe>
It's executing the code and save the code while you save the HTML in Tiny Portal
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: IchBin on January 31, 2012, 03:18:27 PM
Thx for reporting! Don't have a lot of time right now to look into the problem. But I suspect you are right, that the code is running through eval() or something and getting parsed when saved or something to that efffect. If someone has a second, please put something in the bugtracker for this.
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: G6Cad on January 31, 2012, 07:25:27 PM
I would have helped you with thaat. but it seems it's off limits to me like most other things i used to have access to hahahaha
No worries through, quite like it this way with no "obligation"  to the "must help where i can"  :2funny:
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on April 15, 2012, 09:36:17 AM
Quote from: IchBinâ,,¢ on January 31, 2012, 03:18:27 PM
Thx for reporting! Don't have a lot of time right now to look into the problem. But I suspect you are right, that the code is running through eval() or something and getting parsed when saved or something to that efffect. If someone has a second, please put something in the bugtracker for this.
Hello IchBin,
I have still this error on a brand new install of SMF and TP.
If you like ... i can give you access to one of my domains, so you can check why this is happens by some hosting company's.
I do not have any other problem with mods/ SMF/ themes or other related things.
Thank you in advance  ;)
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: IchBin on April 16, 2012, 01:15:29 AM
Not sure I'll be able to do anything. This appears to be a problem with the editor itself from what I can see at the moment. I'm no javascript guru, so this may not get fixed if I don't see the problem. :(
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on April 16, 2012, 07:03:18 AM
Thanks for your rely IchBin ;)

If its a JavaScript error like you mentioned, it's possible that i will find and correct this issue.
I let you know one off these days the result  ::)
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: Ron Austin on April 25, 2012, 03:39:14 PM
I have noticed the same problem.  Also when I enter code in HTML mode and switch to hide HTML the text looks good, but when I save it and go to the web page the line spacing is all scrunched up and doesn't look the same as it did in the WYSIWYG mode of the editor.
Title: Re: HTML CODE gives extra strings, after saving ...
Post by: ClickSafe on April 25, 2012, 04:08:15 PM
Hi Ron,
This weekend i have some time to search where it goes wrong.
Like IchBin says its not so easy to find there the problem will be inside the JavaScript.
:) Danny