TinyPortal

Development => Support => Topic started by: jmayne on March 20, 2008, 02:27:25 PM

Title: Script Block vs. Script Box
Post by: jmayne on March 20, 2008, 02:27:25 PM
I was told that I could embed youtube (embed HTML) using a scriptblock.  When I select the block Type (from the dropdown), I see I have the choice of selecting Scriptbox.  Is a scriptblock the same thing as a scriptbox.

FYI, embedding youtube HTML into a scriptbox does not work for me.  All I see is the HTML.
Title: Re: Script Block vs. Script Box
Post by: Zetan on March 20, 2008, 02:40:56 PM
Script block, box.. same thing.

Whats the code you are trying to insert?
Title: Re: Script Block vs. Script Box
Post by: jmayne on March 20, 2008, 02:45:32 PM
I am testing with this:

<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=3155486377708538088&hl=en" flashvars=""> </embed>

It's a little line rider clip I have on Google video.
Title: Re: Script Block vs. Script Box
Post by: Zetan on March 20, 2008, 02:50:49 PM
Please use the code tags when posting code. The button with the # symbol

That video works fine.. it's a Google video. I have it on the Home Page of my site and will take it down again soon.

http://labradio.co.uk/index.php
Title: Re: Script Block vs. Script Box
Post by: JPDeni on March 20, 2008, 02:54:57 PM
Works for me. Make absolutely sure you are using a scriptbox and not an html + BBC block.
Title: Re: Script Block vs. Script Box
Post by: jmayne on March 20, 2008, 06:35:47 PM
Quote from: ZTN on March 20, 2008, 02:50:49 PM
Please use the code tags when posting code. The button with the # symbol

That video works fine.. it's a Google video. I have it on the Home Page of my site and will take it down again soon.

http://labradio.co.uk/index.php

I'm sure I am doing something wrong.

In the Block Manager, I click "Add Center Block."  On the next screen, it tells me "You have successfully created a new block. Here you can set what type this new block should be."  So, I tick scriptbox, then click Save.

At that point I am taken to the screen where I can add a title as well as enter information as to what I want in the Body of my scriptbox.  So , in the body, I past this:

<font size="4">&lt;embed style=&quot;width:400px; height:326px;&quot; id=&quot;VideoPlayback&quot; type=&quot;application/x-shockwave-flash&quot; src=&quot;http://video.google.com/googleplayer.swf?docId=3155486377708538088&amp;hl=en&quot; flashvars=&quot;&quot;&gt; &lt;/embed&gt;</font>

I go to the bottom of this page and click Save.  I am then brought back to the main Block Manager page.  I turn the box "on."  then go to the bottom and click Save.

Then I go to my forum to see what this new center block looks like.  In it I see the HTML code that I pasted into the body.

There is no button with the # symbol as ZTN refers to, anywhere along the way.

I'm sure I'm missing a step here.
Title: Re: Script Block vs. Script Box
Post by: Ken. on March 20, 2008, 07:10:14 PM
ZTN is speaking of posting your code in your message here... makes it lots easier to read and makes it display correctly. Displaying correctly may, or may not happen when you do a simple copy & paste into a forum post.

See the screen shot below.
Also an alternative method would be to manually type in the 'code' tags: [ code][ /code] (without the spaces).
Title: Re: Script Block vs. Script Box
Post by: JPDeni on March 20, 2008, 07:13:06 PM
In the script box, paste


<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=3155486377708538088&hl=en" flashvars=""> </embed>


That's what I did and it worked just fine.
Title: Re: Script Block vs. Script Box
Post by: jmayne on March 20, 2008, 07:25:59 PM
JPDeni,

That worked great.  So, I was copying and pasting the wrong thing.  In the future, how will I know what to copy and paste.  The code you sent to me is not what I am being provided by Google or Youtube.

How did you know the right stuff?  How can I learn how to do it?
Title: Re: Script Block vs. Script Box
Post by: JPDeni on March 20, 2008, 07:36:14 PM
QuoteThe code you sent to me is not what I am being provided by Google or Youtube.

The code I used was the code you first posted. Your second post in this topic. Wherever you got that, is what you want to copy in the future. If you end up seeing things like =&quot;&quot;&gt; &lt;, that means that there has been some sort of translation of your code, trying to print out the text, rather than to parse the html. My guess is that you started with an html + BBC block, found that didn't work, copied the text from the display and tried to put it into a scriptbox. If you copy the text from YouTube or Google and paste it directly into the scriptbox.

QuoteHow did you know the right stuff?

I recognize html when I see it. I've studied it and created web pages with it.

QuoteHow can I learn how to do it?

Learn html. There's lots of good references on the 'net.
Title: Re: Script Block vs. Script Box
Post by: Ken. on March 20, 2008, 07:37:53 PM
In a situation like this my own personal approach is to play around a little with the code provided and try to see what is not needed or seems out of place.

So I tried your code and the first thing that jumped out was the font size tags... there was no reason for them to be there so I removed those and then your code worked OK.

JPDeni is the code expert of course so we all listen to her, but with a little trial and error folks like you and me can sometimes sort it out on our own.  ;)


Title: Re: Script Block vs. Script Box
Post by: jmayne on March 20, 2008, 07:57:24 PM
You were absolutely right.  I originally pasted it into an HTML + BBC.  When that didn't work, I copied that and put it into a scriptbox and that didn't work either (because it changed).  Very good diagnosis.  Kind of creepy - it's almost as if you watched what I did  :o.
Title: Re: Script Block vs. Script Box
Post by: Zetan on March 20, 2008, 08:20:25 PM
lol, nope.. but it's something that happens with WYSIWYG type editors. They often add in their own formatting.. Theres a difference between HTML and BBC (Bulletin Board Code). BBC is formatted to allow general users some amount of customistation/formatting to posts.

The BBC is wrapped in [tags]
Whereas much of html is wrapped in <tags>

It's mainly a security thing.. It's not a good idea to let just anybody insert html into posts, which gets inserted into the database.
Title: Re: Script Block vs. Script Box
Post by: G6Cad on March 23, 2008, 10:43:11 AM
This seems to be fixed so i mark this as solved :)