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

#1 2013-01-09 16:36:04

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Pick Random Forum Code

Well I've been on scratch for awhile, and while here, I've seen some signatures that automatically pick a random one from whatever was given them. Now, I would like to apply this to my Shop Directory and have a random "featured" shop each time it's visited. So, could someone be kind enough to provide some code that'll work with over 30 slots (or as high as possible if 30 isn't possible) for shops?

Oh, and this is a side questions, but will there be any new music formats supported by Scratch 2.0?

Thanks for any answers!

Last edited by ErnieParke (2013-01-09 16:38:20)


http://i46.tinypic.com/35ismmc.png

Offline

 

#2 2013-01-09 17:40:54

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

Re: Pick Random Forum Code


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 2013-01-10 19:07:19

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Pick Random Forum Code

That's nice and all, but there's a problem. Yes, the forum that you gave lets you have random pictures, random links, or random text, but the problem is that I need everything that'll appear to be from the same shop, which I currently can't see how to do that with what you've given.

Last edited by ErnieParke (2013-01-10 19:13:26)


http://i46.tinypic.com/35ismmc.png

Offline

 

#4 2013-01-16 18:11:39

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Pick Random Forum Code

Bump
Up
My
Post (Or for fun, pineapple.)

Last edited by ErnieParke (2013-01-16 18:12:02)


http://i46.tinypic.com/35ismmc.png

Offline

 

#5 2013-01-16 18:27:19

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Pick Random Forum Code

I don't think there's any way to do this besides the method Jvvg said.


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#6 2013-01-16 21:32:49

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Pick Random Forum Code

ErnieParke wrote:

That's nice and all, but there's a problem. Yes, the forum that you gave lets you have random pictures, random links, or random text, but the problem is that I need everything that'll appear to be from the same shop, which I currently can't see how to do that with what you've given.

Could you be a bit more clear? So far what I understand if that you want to pick a random picture out of 30, to then display it in a "shop" thread, and that's exactly what the random image API is meant for.  hmm


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#7 2013-01-16 22:00:11

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Pick Random Forum Code

The random image API only works with upto 10 images.

You'd have to code your own PHP random image server to make it 30+.

I have a website that serves up a random image everytime the reload button is clicked, or the webpage is reloaded. Currently it only chooses from 3 images, but it can use as many images as you want.

Javascript can also be used if it is a website.

meanwhileinaustralia.tk


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#8 2013-01-16 22:00:32

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Pick Random Forum Code

Edit: Made some things more clearer.

technoguyx wrote:

ErnieParke wrote:

That's nice and all, but there's a problem. Yes, the forum that you gave lets you have random pictures, random links, or random text, but the problem is that I need everything that'll appear to be from the same shop, which I currently can't see how to do that with what you've given.

Could you be a bit more clear? So far what I understand if that you want to pick a random picture out of 30, to then display it in a "shop" thread, and that's exactly what the random image API is meant for.  hmm

Okay, so what I want is to have random text with a link, followed possibly by a radnom image, and then most likely followed by more random text. The problem that arises is that all of those random objects need to be from the same shop, and the API in that thread, as far as I can see, can't do that. Just in summarization of what I need:

1). Some random text with a link.
2). Poissibly a random image.
3). Most likely more random text.
4). All of this to be from the same shop, and not from different shops.

Oh, and on a side note, when I say "random", I don't mean gibberish as in "ghedfjuf", but instead as in a random choice from what's been put in.

jji7skyline wrote:

The random image API only works with upto 10 images.

You'd have to code your own PHP random image server to make it 30+.

I have a website that serves up a random image everytime the reload button is clicked, or the webpage is reloaded. Currently it only chooses from 3 images, but it can use as many images as you want.

Javascript can also be used if it is a website.

meanwhileinaustralia.tk

That's nice to know, but I just went to your server and it's been taken down due to "inactivity".  hmm

Edit: Made some things more clearer.

Last edited by ErnieParke (2013-01-16 22:17:37)


http://i46.tinypic.com/35ismmc.png

Offline

 

#9 2013-01-16 22:17:04

Blazingwave
Scratcher
Registered: 2012-10-27
Posts: 500+

Re: Pick Random Forum Code

Couldnt you just change the random featured shop per day manually?
Or you could have a REALLY slow animated gif of everyshop banner like my signature but slower.


http://i42.tinypic.com/t8nrlh.gif  http://blocks.scratchr.org/API.php?user=Blazingwave&action=onlineStatus&online=http://i49.tinypic.com/25flloj.gif=http://i45.tinypic.com/o8i97l.gif
http://i41.tinypic.com/s1lyyo.jpg

Offline

 

#10 2013-01-18 15:07:58

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Pick Random Forum Code

Blazingwave wrote:

1). Couldnt you just change the random featured shop per day manually?
2). Or you could have a REALLY slow animated gif of everyshop banner like my signature but slower.

1). I could, but I'd rather avoid that.
2). Maybe, but the problem with this is that I'd have to take a screenshot of every shop, edit it, and upload it to imgur, and that would tak a lot of work. Also, wouldn't the .gif start at the same place each time? That way, there would only be 1 featured shop all year long, which I don't want.


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer