This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-01 22:05:27

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Using scratchblocks on your forum!

I've figured out how!
First, you need to add the block images.
Those are the .png files here.

Next, you need to parse the scripts, which is where we split into 2:

For phpBB
Add this code to the top of your scripts_footer.html (in template) or overall_footer.html if you don't have it:

Code:

<script type="text/javascript" src="http://scratch.mit.edu/ext/blocksplugin/blocksplugin.js"></script>
<script type="text/javascript">
var blocks = document.getElementsByClassName("blocks");
var i;
for (i=0; i<blocks.length; i++) {
  if (blocks[i].innerText)
    blocks[i].innerHTML = blocks[i].innerText;
  else {
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/<br \/>/gi, "\r\n");
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/<br>/gi, "\r\n");
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/&/g, "&amp;");
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/</g, "&lt;");
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/>/g, "&gt;");
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/"/g, "&quot;");
    blocks[i].innerHTML = blocks[i].innerHTML.replace(/'/, "'");
  }
}
scratchBlocksPlugin.parse({containerTag: 'pre', containerClass: 'blocks'});
</script>

And add the following BBCode tag:

Code:

[scratchblocks]{TEXT}[/scratchblocks]

Makes:

Code:

<pre class="blocks">{TEXT}</pre>

For PunBB/FluxBB
Add the code that corresponds to your version to the bottom of main.tpl, just before </body>:
PunBB

Code:

<script type="text/javascript" src="http://geonotron.net84.net/scratchblocks/punbb.js"></script>

FluxBB 1.2

Code:

<script type="text/javascript" src="http://geonotron.net84.net/scratchblocks/fluxbb-1.2.js"></script>

FluxBB 1.3 (Rare)

Code:

<script type="text/javascript" src="http://geonotron.net84.net/scratchblocks/fluxbb-1.3.js"></script>

FluxBB 1.4

Code:

<script type="text/javascript" src="http://geonotron.net84.net/scratchblocks/fluxbb-1.4.js"></script>

FluxBB 1.5

Code:

<script type="text/javascript" src="http://geonotron.net84.net/scratchblocks/fluxbb-1.5.js"></script>

If you use PunBB Hosting or other hosting where you can't access the filesystem and add the block images (below), you should add this right beneath the Pun/Flux code:

Code:

<script type="text/javascript" src="http://geonotron.net84.net/forums/plugins/resourcegrab.js"></script>

Next, we must celebrate!

when gf clicked
repeat (1000)
  celebrate
end
stop all

Last edited by GeonoTRON2000 (2012-06-16 17:45:30)


http://i.imgur.com/BAEgGDL.png

Offline

 

#2 2012-06-01 22:06:12

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Using scratchblocks on your forum!

Nice guide! I wonder what LS97 has to say about adding this to Mod Share. I think we talked about it once.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-06-01 22:07:39

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

jvvg wrote:

Nice guide! I wonder what LS97 has to say about adding this to Mod Share. I think we talked about it once.

Thanks!


http://i.imgur.com/BAEgGDL.png

Offline

 

#4 2012-06-02 00:07:01

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

:bump:


http://i.imgur.com/BAEgGDL.png

Offline

 

#5 2012-06-02 05:22:09

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Using scratchblocks on your forum!

The link to your forums in your sig doesn't work.  hmm

Hyperlinked page wrote:

Error 404: File Not Found

(+/-) More Information

Last edited by nathanprocks (2012-06-02 05:22:23)


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&amp;display=small

Offline

 

#6 2012-06-02 06:24:51

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Using scratchblocks on your forum!

nathanprocks wrote:

The link to your forums in your sig doesn't work.  hmm

Hyperlinked page wrote:

Error 404: File Not Found

(+/-) More Information

This link should work: http://geonotron.net84.net/forums/


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7 2012-06-02 08:08:34

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Using scratchblocks on your forum!

Where is the viewtopic thing. This is my forums:
joletolesforum.punbb-hosting.com

Offline

 

#8 2012-06-02 08:18:49

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Using scratchblocks on your forum!

joletole wrote:

Where is the viewtopic thing. This is my forums:
joletolesforum.punbb-hosting.com

In your /forums folder, there is a file called viewtopic.php. I don't think you can edit the forum software with punbb-hosting though.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&amp;display=small

Offline

 

#9 2012-06-02 12:52:54

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

nathanprocks wrote:

joletole wrote:

Where is the viewtopic thing. This is my forums:
joletolesforum.punbb-hosting.com

In your /forums folder, there is a file called viewtopic.php. I don't think you can edit the forum software with punbb-hosting though.

No, I think you can (you certainly can with phpBB).
Try going to the admin panel and editing your style.
If it lets you edit the template, go ahead and edit the file that's something like scripts_footer.html, and put the code there.


http://i.imgur.com/BAEgGDL.png

Offline

 

#10 2012-06-02 12:56:26

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: Using scratchblocks on your forum!

GeonoTRON2000 wrote:

nathanprocks wrote:

joletole wrote:

Where is the viewtopic thing. This is my forums:
joletolesforum.punbb-hosting.com

In your /forums folder, there is a file called viewtopic.php. I don't think you can edit the forum software with punbb-hosting though.

No, I think you can (you certainly can with phpBB).
Try going to the admin panel and editing your style.
If it lets you edit the template, go ahead and edit the file that's something like scripts_footer.html, and put the code there.

Hmm..., I need help. Join my forum, then I will make you admin so you can do this.

Offline

 

#11 2012-06-02 14:29:11

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

joletole wrote:

GeonoTRON2000 wrote:

nathanprocks wrote:


In your /forums folder, there is a file called viewtopic.php. I don't think you can edit the forum software with punbb-hosting though.

No, I think you can (you certainly can with phpBB).
Try going to the admin panel and editing your style.
If it lets you edit the template, go ahead and edit the file that's something like scripts_footer.html, and put the code there.

Hmm..., I need help. Join my forum, then I will make you admin so you can do this.

I did  big_smile
I'm GeonoTRON2000


http://i.imgur.com/BAEgGDL.png

Offline

 

#12 2012-06-02 16:28:12

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

bump [this topic v]


http://i.imgur.com/BAEgGDL.png

Offline

 

#13 2012-06-02 17:07:34

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

hey, joletole, I added the scratchblocks to your forum.


http://i.imgur.com/BAEgGDL.png

Offline

 

#14 2012-06-02 22:43:04

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

when gf clicked
say [bump] for (2) secs


http://i.imgur.com/BAEgGDL.png

Offline

 

#15 2012-06-02 23:21:57

fetchydog567
Scratcher
Registered: 2011-12-28
Posts: 500+

Re: Using scratchblocks on your forum!

Yay this is a great tutorial for me


http://www.minecraftanonymous.com/assets/banners/banner_51.pngJust a reminder I won't be on Scratch that much but I 'll still be here, so if i'm on something, I will be commenting back, okay! wink , PICO Team!!!!!!!!!!! SCRATCH DEADW!!! PICO HACK ACCOUTNTT@@

Offline

 

#16 2012-06-03 10:12:34

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

Re: Using scratchblocks on your forum!

Found a glitch.

If you do repeat, the | | connector bar doesn't show up.


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#17 2012-06-03 12:05:23

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

funelephant wrote:

Found a glitch.

If you do repeat, the | | connector bar doesn't show up.

What do you mean?
Can you show an example?

repeat until <(glitch) = [fixed]>
  say [uh-oh]


http://i.imgur.com/BAEgGDL.png

Offline

 

#18 2012-06-03 12:31:02

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

Re: Using scratchblocks on your forum!

GeonoTRON2000 wrote:

funelephant wrote:

Found a glitch.

If you do repeat, the | | connector bar doesn't show up.

What do you mean?
Can you show an example?

repeat until <(glitch) = [fixed]>
  say [uh-oh]

On my forums. In the Welcome to the new forums topic.


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#19 2012-06-03 12:32:02

funelephant
Scratcher
Registered: 2010-07-02
Posts: 1000+

Re: Using scratchblocks on your forum!

funelephant wrote:

GeonoTRON2000 wrote:

funelephant wrote:

Found a glitch.

If you do repeat, the | | connector bar doesn't show up.

What do you mean?
Can you show an example?

repeat until <(glitch) = [fixed]>
  say [uh-oh]

On my forums. In the Welcome to the new forums topic.

Never mind, it's fixed  big_smile


nicki begs to differ
http://24.media.tumblr.com/ab0e6e8fd347c5e39c2821bcab9d16e6/tumblr_mgu35sui1L1rfb7aqo2_500.gif

Offline

 

#20 2012-06-03 12:56:23

williambl
Scratcher
Registered: 2011-04-08
Posts: 100+

Re: Using scratchblocks on your forum!

The when green flag clicked block is glitchy on my forums..


http://internetometer.com/imagesmall/34650.png
http://www.danasoft.com/sig/Epicnesssign.jpg

Offline

 

#21 2012-06-03 13:33:17

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

williambl wrote:

The when green flag clicked block is glitchy on my forums..

To get hat block and C blocks to work correctly, you need to upload these images to your forums root directory:
gf.png
http://img214.imageshack.us/img214/8501/64730809.png
hat_bg.png
http://img194.imageshack.us/img194/6569/hatbg.png
cwrap.png
http://img16.imageshack.us/img16/5030/cwrap.png


http://i.imgur.com/BAEgGDL.png

Offline

 

#22 2012-06-03 15:18:07

williambl
Scratcher
Registered: 2011-04-08
Posts: 100+

Re: Using scratchblocks on your forum!

GeonoTRON2000 wrote:

williambl wrote:

The when green flag clicked block is glitchy on my forums..

To get hat block and C blocks to work correctly, you need to upload these images to your forums root directory:
gf.png
http://img214.imageshack.us/img214/8501/64730809.png
hat_bg.png
http://img194.imageshack.us/img194/6569/hatbg.png
cwrap.png
http://img16.imageshack.us/img16/5030/cwrap.png

How do I do that with punbb hosting?


http://internetometer.com/imagesmall/34650.png
http://www.danasoft.com/sig/Epicnesssign.jpg

Offline

 

#23 2012-06-03 15:22:06

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

williambl wrote:

GeonoTRON2000 wrote:

williambl wrote:

The when green flag clicked block is glitchy on my forums..

To get hat block and C blocks to work correctly, you need to upload these images to your forums root directory:
gf.png
http://img214.imageshack.us/img214/8501/64730809.png
hat_bg.png
http://img194.imageshack.us/img194/6569/hatbg.png
cwrap.png
http://img16.imageshack.us/img16/5030/cwrap.png

How do I do that with punbb hosting?

I'm working on a script for that now...


http://i.imgur.com/BAEgGDL.png

Offline

 

#24 2012-06-03 15:25:00

williambl
Scratcher
Registered: 2011-04-08
Posts: 100+

Re: Using scratchblocks on your forum!

GeonoTRON2000 wrote:

williambl wrote:

GeonoTRON2000 wrote:


To get hat block and C blocks to work correctly, you need to upload these images to your forums root directory:
gf.png
http://img214.imageshack.us/img214/8501/64730809.png
hat_bg.png
http://img194.imageshack.us/img194/6569/hatbg.png
cwrap.png
http://img16.imageshack.us/img16/5030/cwrap.png

How do I do that with punbb hosting?

I'm working on a script for that now...

Great!


http://internetometer.com/imagesmall/34650.png
http://www.danasoft.com/sig/Epicnesssign.jpg

Offline

 

#25 2012-06-03 15:43:04

GeonoTRON2000
Scratcher
Registered: 2009-12-24
Posts: 1000+

Re: Using scratchblocks on your forum!

Here's what I have (place under the embed code in the first post):

Code:

<script type="text/javascript">
// basic settings
var protocol = self.location.href.split("/")[0].substring(0, self.location.href.split("/")[0].length-1);
var base_url = self.location.href.split("/")[2];
var L;
var directory = "";
for (L = 3; L < self.location.href.split("/").length-1; L++) {
  directory += "/"+self.location.href.split("/")[L];
}
L=null;
// the green flag
var imgs = document.getElementsByTagName("img");
for (L = 0; L < imgs.length; L++) {
  if (imgs[L].src==protocol+"://"+base_url+directory+"/gf.png" || imgs[L].src == "gf.png") {
    imgs[L].src = "http://scratch.mit.edu/ext/blocksplugin/gf.png";
  }
}
L = null;

// the hat block and C block
var divs = document.getElementsByTagName("div");
for (L = 0; L < divs.length; L++) {
  var div = divs[L];
  if (div.style.backgroundImage == "url("+protocol+"://"+base_url+directory+"/hat_bg.png)" || div.style.backgroundImage == "url('"+protocol+"://"+base_url+directory+"/hat_bg.png')" || div.style.backgroundImage == "url('hat_bg.png')" || div.style.backgroundImage == "url(hat_bg.png)") {
     div.style.backgroundImage = "url(http://scratch.mit.edu/ext/blocksplugin/hat_bg.png)";
  }
  else if (div.style.backgroundImage == "url("+protocol+"://"+base_url+directory+"/cwrap.png)" || div.style.backgroundImage == "url('"+protocol+"://"+base_url+directory+"/cwrap.png')" || div.style.backgroundImage == "url('cwrap.png')" || div.style.backgroundImage == "url(cwrap.png)") {
     div.style.backgroundImage = "url(http://scratch.mit.edu/ext/blocksplugin/cwrap.png)";
  }
}
</script>

Can you test it for me?

Last edited by GeonoTRON2000 (2012-06-03 15:49:36)


http://i.imgur.com/BAEgGDL.png

Offline

 

Board footer