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

#201 2012-04-17 08:10:10

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

edit: nevermind, i got it!
the debugged code is here

Code:

// ==UserScript==
// @name           Antidote!
// @namespace      rookwood101,Cocolover,LS97,flashgocrazy,roijac
// @description    Enable youtube and projects on scratch forum
// @include        http://scratch.mit.edu/forums/viewtopic.php*
// @version        1.1
// ==/UserScript==
var version = 11;
if (document.URL.indexOf('http://scratch.mit.edu/forums/viewtopic.php') != -1) {
    var containerelements = Array.prototype.slice.call(document.getElementsByClassName('postmsg')).concat(Array.prototype.slice.call(document.getElementsByClassName('incqbox')));
    var p_elements = new Array();
    for (i=0;i<containerelements.length;i++) {
        p_elements = p_elements.concat(Array.prototype.slice.call(containerelements[i].getElementsByTagName('p')));
    }
    for (j=0;j<p_elements.length;j++) {
        
        var code = p_elements[j].innerHTML;
    
        //replace youtube tags
        var addYoutube = code;
        var youtubeids = new Array();
        for (i=0;i<addYoutube.split(/\[youtube\]/i).length-1;i++) {
            youtubeids[i] = addYoutube.split(/\[youtube\]/i)[i+1].split(/\[\/youtube\]/i)[0];
            if (youtubeids[i].replace(/[a-zA-Z0-9\-_]+/, "") != "") {
                youtubeids[i] = 'dQw4w9WgXcQ';
            }
        }

        for (i=0;i<youtubeids.length;i++) {
            addYoutube = addYoutube.replace(/\[youtube\]([a-zA-Z0-9\-_]+)\[\/youtube\]/i, '<iframe width="510" height="315" src="http://www.youtube.com/embed/' + youtubeids[i] + '"frameborder="0" allowfullscreen></iframe>');
        }
    
        //replace project tags
        var projectpath = new Array();
        for (i=0;i<addYoutube.split(/\[scratch=flash\]/i).length-1;i++) {
            projectpath[i] = addYoutube.split(/\[scratch=flash\]/i)[i+1].split(/\[\/scratch\]/i)[0];
            if (projectpath[i].replace(/[a-zA-Z0-9]+\/[0-9]+/i, "") != "") {
                projectpath[i] = 'Mike16112/675815';
            }
        }
        var addProjects = addYoutube;
        for (i=0;i<projectpath.length;i++) {
            addProjects = addProjects.replace(/\[scratch=flash\]([a-zA-Z0-9]+\/[0-9]+)\[\/scratch\]/i, '<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="always"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/' + projectpath[i] + '.sb?version=1.1"></object>');
        }
    
        //Saving Changes
        p_elements[j].innerHTML = addProjects;
        
    }
    document.getElementsByTagName("body")[0].innerHTML = document.getElementsByTagName("body")[0].innerHTML.replace(/antidoteexists=false/ig, 'antidoteexists=true&version=' + version);
}

This fixes the problem of bbcode inside [code ] tag, which now doesn't get parsed. rookwood, you should probably update the script, LS97 should probably ipdate the php code to alert the user if the version is smaller than 11  smile

edit: forgot to say i also removed the [img] tag parsing

Last edited by roijac (2012-04-17 09:38:42)

Offline

 

#202 2012-04-17 09:18:21

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

You know images are back on, roijac?

Offline

 

#203 2012-04-17 09:37:52

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

of course i know tat
it now has images disabled, but videos and projects is still nice to have

Offline

 

#204 2012-04-17 10:51:58

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: Adding the images back in to your scratch forum experience

roijac wrote:

edit: nevermind, i got it!
the debugged code is here

Code:

// ==UserScript==
// @name           Antidote!
// @namespace      rookwood101,Cocolover,LS97,flashgocrazy,roijac
// @description    Enable youtube and projects on scratch forum
// @include        http://scratch.mit.edu/forums/viewtopic.php*
// @version        1.1
// ==/UserScript==
var version = 11;
if (document.URL.indexOf('http://scratch.mit.edu/forums/viewtopic.php') != -1) {
    var containerelements = Array.prototype.slice.call(document.getElementsByClassName('postmsg')).concat(Array.prototype.slice.call(document.getElementsByClassName('incqbox')));
    var p_elements = new Array();
    for (i=0;i<containerelements.length;i++) {
        p_elements = p_elements.concat(Array.prototype.slice.call(containerelements[i].getElementsByTagName('p')));
    }
    for (j=0;j<p_elements.length;j++) {
        
        var code = p_elements[j].innerHTML;
    
        //replace youtube tags
        var addYoutube = code;
        var youtubeids = new Array();
        for (i=0;i<addYoutube.split(/\[youtube\]/i).length-1;i++) {
            youtubeids[i] = addYoutube.split(/\[youtube\]/i)[i+1].split(/\[\/youtube\]/i)[0];
            if (youtubeids[i].replace(/[a-zA-Z0-9\-_]+/, "") != "") {
                youtubeids[i] = 'dQw4w9WgXcQ';
            }
        }

        for (i=0;i<youtubeids.length;i++) {
            addYoutube = addYoutube.replace(/\[youtube\]([a-zA-Z0-9\-_]+)\[\/youtube\]/i, '<iframe width="510" height="315" src="http://www.youtube.com/embed/' + youtubeids[i] + '"frameborder="0" allowfullscreen></iframe>');
        }
    
        //replace project tags
        var projectpath = new Array();
        for (i=0;i<addYoutube.split(/\[scratch=flash\]/i).length-1;i++) {
            projectpath[i] = addYoutube.split(/\[scratch=flash\]/i)[i+1].split(/\[\/scratch\]/i)[0];
            if (projectpath[i].replace(/[a-zA-Z0-9]+\/[0-9]+/i, "") != "") {
                projectpath[i] = 'Mike16112/675815';
            }
        }
        var addProjects = addYoutube;
        for (i=0;i<projectpath.length;i++) {
            addProjects = addProjects.replace(/\[scratch=flash\]([a-zA-Z0-9]+\/[0-9]+)\[\/scratch\]/i, '<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="always"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/' + projectpath[i] + '.sb?version=1.1"></object>');
        }
    
        //Saving Changes
        p_elements[j].innerHTML = addProjects;
        
    }
    document.getElementsByTagName("body")[0].innerHTML = document.getElementsByTagName("body")[0].innerHTML.replace(/antidoteexists=false/ig, 'antidoteexists=true&version=' + version);
}

This fixes the problem of bbcode inside [code ] tag, which now doesn't get parsed. rookwood, you should probably update the script, LS97 should probably ipdate the php code to alert the user if the version is smaller than 11  smile

edit: forgot to say i also removed the [url]tag parsing

Great work! I think we should maybe think up a way of making it so only trusted members can use it, although there's no definitive way to do this.


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

Offline

 

#205 2012-04-17 11:19:59

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

next issue is to find a way of preventing projects from being autoplaying  smile

another detail: projects and videos in sigs don't get parsed, because there's no place for them, so they're a bit unnecessary. i could add that if you want  smile

Last edited by roijac (2012-04-17 11:22:12)

Offline

 

#206 2012-04-17 21:20:43

Lightnin
Scratch Team
Registered: 2008-11-03
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

LS97 wrote:

I will discuss the issue with rookwood101 and I'm sure he will agree to remove Antidote from the "public".

Thanks!

LS97 wrote:

This experimental version of Antidote could certainly turn out to be a productive way of trying out new features for the 2.0 forums. I will definitely be trying this out with rookwood (I already have some ideas  smile  ) and we'll be sure to contact the team if we come up with anything interesting!

Sounds good!


Help Scratchers make the leap to 2.0!
http://img818.imageshack.us/img818/6844/transitionteam.jpg

Offline

 

#207 2012-04-27 16:29:28

123therealwoodstock
Scratcher
Registered: 2012-03-31
Posts: 4

Re: Adding the images back in to your scratch forum experience

Is it possible to add a video file to your scratch project?

Offline

 

#208 2012-04-27 17:05:26

PullJosh
Scratcher
Registered: 2011-08-01
Posts: 500+

Re: Adding the images back in to your scratch forum experience

123therealwoodstock wrote:

Is it possible to add a video file to your scratch project?

Not unless you hack scratch! (If you want to do just that, search shift-click R in the search bar on the main site.)

Last edited by PullJosh (2012-04-27 17:05:40)


http://www.blocks.scratchr.org/API.php?action=text&amp;string=I'm_on_vacation!&amp;xpos=155&amp;ypos=90&amp;font_size=30&amp;bgimage=http://imageshack.us/a/img339/7215/sspeechsigapiforwords.png

Offline

 

#209 2012-04-27 17:18:05

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

PullJosh wrote:

123therealwoodstock wrote:

Is it possible to add a video file to your scratch project?

Not unless you hack scratch! (If you want to do just that, search shift-click R in the search bar on the main site.)

Oh, and you aren't actually hacking Scratch, when you do that.


Get ready for domination of:  tongue

Offline

 

#210 2012-05-12 11:18:37

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

rookwood, I don't know if this is under your area of expertise, but I downloaded the latest version of flash for Internet Explorer 9, put it in compatibility mode, and the flahs player won't work.  Can you help me?  Thanks.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#211 2012-06-09 23:12:17

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Adding the images back in to your scratch forum experience

the pictures work (always); but youtube and scratch work. lets see if HTML iFrames work. Instead of letting scratch convert it, nobody does!:

Code:

<iFrame src="http://scratch.mit.edu/rookwood101/1951425"></iFrame>

<iFrame src="http://scratch.mit.edu/rookwood101/1951425"></iFrame>


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

#212 2012-06-09 23:18:16

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Adding the images back in to your scratch forum experience

Firedrake969 wrote:

rookwood, I don't know if this is under your area of expertise, but I downloaded the latest version of flash for Internet Explorer 9, put it in compatibility mode, and the flahs player won't work.  Can you help me?  Thanks.

your signature; i am running safari on windows! does this smiley work; (~) :~:


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

#213 2012-06-09 23:20:51

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

Firedrake969 wrote:

rookwood, I don't know if this is under your area of expertise, but I downloaded the latest version of flash for Internet Explorer 9, put it in compatibility mode, and the flahs player won't work.  Can you help me?  Thanks.

Simple solution: download firefox!  :p


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#214 2012-06-09 23:23:36

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Adding the images back in to your scratch forum experience

coolhogs wrote:

PullJosh wrote:

123therealwoodstock wrote:

Is it possible to add a video file to your scratch project?

Not unless you hack scratch! (If you want to do just that, search shift-click R in the search bar on the main site.)

Oh, and you aren't actually hacking Scratch, when you do that.

After you Shift-click the R in the scratch logo select 'turn fill screen off', click the white frame, click new morph and look for movie. no you are NOT hacking, it is just using not fill screen mode witch is how you access MIT Squeak and make browser 'hacks' (making scratch a scratch mod through the system browser).


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

#215 2012-06-11 09:04:59

XenoK
Scratcher
Registered: 2011-09-08
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

I would like to suggest a new tag for andidote: the offtopic tag to signify something is offtopic, as seen in this forum thread. (not on scratch)


Eternity Tasks has launched into Alpha One! http://tasks.eternityincurakai.com/EI%20projects.png

Offline

 

#216 2012-06-11 21:20:17

Eternity_Inc
Scratcher
Registered: 2011-12-07
Posts: 100+

Re: Adding the images back in to your scratch forum experience

how does the scratch tag work?  I can't seem to figure it out! do you put the source inside the tags or what?

Offline

 

#217 2012-06-11 21:29:35

Eternity_Inc
Scratcher
Registered: 2011-12-07
Posts: 100+

Re: Adding the images back in to your scratch forum experience

yeah, the scratch tag isnt working for me.

Offline

 

#218 2012-06-19 12:57:13

gagetman
Scratcher
Registered: 2011-10-23
Posts: 26

Re: Adding the images back in to your scratch forum experience

[scratch=flash]gagetman/2568689[/scratch]

Last edited by gagetman (2012-06-19 13:02:47)


I love scratchhttp://wiki.scratch.mit.edu/images/Scratch_Cat-cropped.png
I must be lucky getting to hold the Olympic Torch!

Offline

 

#219 2012-09-28 05:04:00

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Adding the images back in to your scratch forum experience

[scratch=flash]Jonathan50/2794894[/scratch]

Last edited by Jonathan50 (2012-09-28 05:04:47)


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

#220 2012-09-28 05:08:16

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

Jonathan50 wrote:

[scratch=flash]Jonathan50/2794894[/scratch]

That is a necropost. Please avoid doing that.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#221 2012-09-28 16:54:15

Jonathan50
Scratcher
Registered: 2011-07-06
Posts: 100+

Re: Adding the images back in to your scratch forum experience

flashgocrazy wrote:

[youtube]JTuXPUP06H0[/youtube] test

Last edited by Jonathan50 (2012-09-28 16:54:50)


Jonathan50
big_smile  http://scratch.mit.edu/img/pages/credits/cat-face-bullet.gif http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=onlineStatus&amp;type=square         http://blocks.scratchr.org/API.php?user=Jonathan50&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1

Offline

 

#222 2012-09-29 20:28:57

dvd4
Scratcher
Registered: 2010-06-30
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

jontmy00 wrote:

Jonathan50 wrote:

[scratch=flash]Jonathan50/2794894[/scratch]

That is a necropost. Please avoid doing that.

but the tread is still relevant


I made a mod  big_smile  It's called blook!
http://i49.tinypic.com/16ia63p.png

Offline

 

#223 2012-12-22 08:46:41

bannanaman
Scratcher
Registered: 2011-01-15
Posts: 25

Re: Adding the images back in to your scratch forum experience

Hello,

This looks really cool so I thought I would try it out as many of my images NEVER load, however when I click the link Chrome blocks it and when I click more info it says you have  to upload it to the Chrome Store for safety  yikes


*Want a Minecraft Mod? -Yes *Cant find one of you're liking?-Yes *Well you've come to the right place!  wink -Yay! *Message me on one of my projects(preferably my Minecraft mod project for commenting) where you can apply for me to make one for you!
Hope to see you soon!  smile  *** You could visit my (Under construction) website at http://minecraftmodmakers4u.webs.com/ ***

Offline

 

#224 2012-12-22 08:51:53

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

Re: Adding the images back in to your scratch forum experience

bannanaman wrote:

Hello,

This looks really cool so I thought I would try it out as many of my images NEVER load, however when I click the link Chrome blocks it and when I click more info it says you have  to upload it to the Chrome Store for safety  yikes

Well, this topic is really old. Let me tell you the story:

A long long time ago, when even I was a baby at Scratch, the forum images were disabled for everyone because of a recent troll attack. Thousands of scratchers complained, but, one scratcher by the name of rookwood101 created a script so that people could see images again.

The ST approved this and said it was fine that he did this. As you can see by the number of pages, many people downloaded it. But when the ST allowed images back, this antidote didn't work and caused a lot of glitches.

One scratch even created a topic saying people shouldn't download the antidote any more because it didn't work.

Well, that's my story!

Offline

 

#225 2012-12-23 17:11:17

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Adding the images back in to your scratch forum experience

dvd4 wrote:

but the tread is still relevant

No it's not.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

Board footer