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

#1001 2012-04-16 16:02:30

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Alright, so I thought I would go ahead and detail a rough plan for the library site.

I'm going to start trying out this new wood look for the site, play around with that a bit and try and find a way of open-sourcing the pages as I develop them (minus any passwords). Meanwhile, the log book will hopefully end up being a place that librarians can actually edit certain pages, PHP and all! As well as upload images. I can't give librarians full access because Andres doesn't want me to give full access to anyone for security reasons, so creating full access for some non-essential pages is a good plan, I think and should speed development.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1002 2012-04-16 16:04:41

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

anyone have an idea for the library's 3-part slogan? (Like imagine, program, share)

I've also updated the home page with the new look!

Last edited by sparks (2012-04-16 16:21:44)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1003 2012-04-16 16:42:20

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

I'm going to [...] try and find a way of open-sourcing the pages as I develop them (minus any passwords).

I would suggest using some source code repository then have an install.php file which creates the config.php file. So then you upload the source to the repository and the website after each update, but when you update the website, it'll just replace all the files on their, keeping the config.php file safe from any overwrites and prying eyes.

Offline

 

#1004 2012-04-16 17:20:40

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

ProgrammingFreak wrote:

sparks wrote:

Okay, thanks for the input!

How about http://dl.dropbox.com/u/22935223/woody2.PNG

Hmm, I'm not sure that I agree with Trocket that contrast is a bad thing... Then again I'm not really an artist, so what do other people think? Should I reduce it? I basically did it cos I wanted a width for the site that most screens can fit (I didn't go 800*600 but went up to the 1024*768). Then I needed some sort of background to that fitting box  tongue

I like the look of this. And yes, sometimes contrast is bad, but I don't think it applies here.  smile

+1 to the design and ProgrammingFreak's statement.  I think it looks amazing!   smile

Offline

 

#1005 2012-04-16 17:32:02

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Magnie wrote:

sparks wrote:

I'm going to [...] try and find a way of open-sourcing the pages as I develop them (minus any passwords).

I would suggest using some source code repository then have an install.php file which creates the config.php file. So then you upload the source to the repository and the website after each update, but when you update the website, it'll just replace all the files on their, keeping the config.php file safe from any overwrites and prying eyes.

Could you explain in a little more detail what you mean? I'm a little confused. I already have database connection code in a connect.php file. I was going to work out a way to write code to allow direct-editing of files on the system, but then limit that to certain files by hand.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1006 2012-04-16 17:41:35

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

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

Magnie wrote:

sparks wrote:

I'm going to [...] try and find a way of open-sourcing the pages as I develop them (minus any passwords).

I would suggest using some source code repository then have an install.php file which creates the config.php file. So then you upload the source to the repository and the website after each update, but when you update the website, it'll just replace all the files on their, keeping the config.php file safe from any overwrites and prying eyes.

Could you explain in a little more detail what you mean? I'm a little confused. I already have database connection code in a connect.php file. I was going to work out a way to write code to allow direct-editing of files on the system, but then limit that to certain files by hand.

I suggest you store the content in a mysql database, through experience I have discovered this is an effective way of doing this - then again, they both have their pros and cons.

On an unrelated note, I made a little mock up for the kind of thing that I could imagine the site looking like (I took into account the wood idea).

http://i.imgur.com/O6b5F.png
Click for a larger version
Any thoughts and feedback are appreciated.

I also followed your advice of setting the width of the centre section where the content would lie to 1024, the sides would just be a tileable image and would obviously scale depending on the user's monitor size.

Last edited by rookwood101 (2012-04-16 17:45:11)


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

Offline

 

#1007 2012-04-16 17:45:42

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Hmmm In general I like it! I think it's a little too dark, a lighter wood might look friendlier but it's a good design!

Of course storing the page code in an SQL database is an excellent idea! Oh, wait, now I remember why I didn't do that; SQL isn't working!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1008 2012-04-16 17:47:31

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

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

Hmmm In general I like it! I think it's a little too dark, a lighter wood might look friendlier but it's a good design!

Of course storing the page code in an SQL database is an excellent idea! Oh, wait, now I remember why I didn't do that; SQL isn't working!

But then again for the site to work as intended at all, SQL would need to be working so the end product could hopefully do this.


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

Offline

 

#1009 2012-04-16 17:49:06

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

That's true. I really need to get it working. So far I have been using arrays for things like librarian lists, which is fine, but not writeable  hmm

It's getting late here, but I'll see if I can devise a test thingy to check how well the SQL database is working now... give me 5 mins....

Last edited by sparks (2012-04-16 17:56:21)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1010 2012-04-16 18:01:07

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

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

That's true. I really need to get it working. So far I have been using arrays for things like librarian lists, which is fine, but not writeable  hmm

It's getting late here, but I'll see if I can devise a test thingy to check how well the SQL database is working now... give me 5 mins....

Have you tried to connect to another mysql database? I could give you a test mysql account on my server if you want.


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

Offline

 

#1011 2012-04-16 18:19:12

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Yes I have tried that, it wouldn't connect to my website's database.

Sigh, I hate javascript sometimes. It says my function is not defined ¬_¬


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1012 2012-04-16 18:21:28

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

Magnie wrote:

sparks wrote:

I'm going to [...] try and find a way of open-sourcing the pages as I develop them (minus any passwords).

I would suggest using some source code repository then have an install.php file which creates the config.php file. So then you upload the source to the repository and the website after each update, but when you update the website, it'll just replace all the files on their, keeping the config.php file safe from any overwrites and prying eyes.

Could you explain in a little more detail what you mean? I'm a little confused. I already have database connection code in a connect.php file. I was going to work out a way to write code to allow direct-editing of files on the system, but then limit that to certain files by hand.

Like the install.php file would create the connect.php file. So this is what happens: You write some code on your computer > It gets uploaded to blocks.scratchr.org and a source code repository (where we can see the code) > You run the install.php on the blocks.scratchr.org website and then use your site a bit then find an error > You write a fix on your computer then upload the fixed version to your website and the repository, keeping the database info hidden but still being able to give out the code.

Offline

 

#1013 2012-04-16 18:23:41

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Oh I see  smile  (I think  tongue  )


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1014 2012-04-16 18:31:17

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

FINALLY!
So it turns out javascript functions can't have the same name as an element on the page...

anyway, please take the test now installed on the http://blocks.scratchr.org/index.php!!!!!

I've tried it a few times and it worked fine. The button uses AJAX to increment a database value and then report the result, checking with the user to see if it worked.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1015 2012-04-16 18:46:47

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Got rid of the stupid addition thing, it might as well calculate itself, so you just get a success/failure message now. I'm going to bed. Tired. Sleep. You guys test it though!!!!

Hmm, I realise there's still a flaw in this. you will get an error message if someone clicks between you loading the page and you clicking the button. I'll fix it tomorrow, but please report any errors all the same. There will be two numbers at the end of the message like 16:17 - please reference those numbers  smile

Last edited by sparks (2012-04-16 18:51:18)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1016 2012-04-16 19:05:56

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

21:20 error   sad

Last edited by Greenatic (2012-04-16 19:06:37)

Offline

 

#1017 2012-04-16 21:21:49

danwoodski
Scratcher
Registered: 2009-12-23
Posts: 100+

Re: Welcome to your local block library! - Website development thread.

Number: 23

Hooray! Everything worked fine, thank you! You can try this again by fully refreshing the page!

Seems to work fine for me (FF 11)!


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://dl.dropbox.com/u/12506914/Pics/p2e-2.png&link2=http://dl.dropbox.com/u/12506914/Pics/ms.png&link3=http://dl.dropbox.com/u/12506914/Pics/block%20lib.png
Starting to move on to other languages, but I'll still be around from time to time  smile

Offline

 

#1018 2012-04-17 04:39:28

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

I just got an error:

29:28

Just so you know, the first number is the number taken from the database beforehand + 1 and the second number is the number read from the database after the update. So if it's less, the update hasn't happened.

So, I may have dreamed of a solution last night to this problem... Well, I say solution, it's not much better but we could effectively do what I did for this test.

Using AJAX, a javascript code can try to update the database, then check for success like this one does. If there is an error it can try again, with a max of say, 5 tries. After that it displays an error message to the user saying the database couldn't be reached (with a try again button) and a button next to it saying "email instead". This would send us some SQL code we can put directly into the database, adding their block manually.

However, that's gonna be picky, a pain and not tidy at all. Rookwood offered to let me use one of his databases, considering mine failed to connect altogether, so I want to give that a try too first...

Last edited by sparks (2012-04-17 04:45:51)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1019 2012-04-17 14:47:18

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

Re: Welcome to your local block library! - Website development thread.

Sparks, if you use your scratch login on: http://mc.lasthorizon.tk/findthepass.php then it should tell you the details for the database I set up for you.


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

Offline

 

#1020 2012-04-17 16:09:17

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Okay, got it, thanks  smile  have you set up external permissions for the database? It it will need to allow external access from blocks.scratchr.org


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1021 2012-04-17 17:05:18

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

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

Okay, got it, thanks  smile  have you set up external permissions for the database? It it will need to allow external access from blocks.scratchr.org

Yeh I set it to allow connections from anywhere.


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

Offline

 

#1022 2012-04-19 17:36:53

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

How about an infinite loop until the update works?  From what I've heard here, it will work eventually  tongue

Offline

 

#1023 2012-04-21 15:36:25

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

I want to avoid an infinite loop, but certainly several tries is possible and may solve the problem...

Does anyone have any ideas for a library-themed login box? There are a few ideas I have but IDK how good they would look. You could just have a normal login box with a wood background, you could have parchment and hide the text boxes above dotted lines on a piece of paper so it looks like you're signing in... The login details could be entered into the string fields of a block... suggestions, thoughts?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#1024 2012-04-21 15:37:52

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

I want to avoid an infinite loop, but certainly several tries is possible and may solve the problem...

Does anyone have any ideas for a library-themed login box? There are a few ideas I have but IDK how good they would look. You could just have a normal login box with a wood background, you could have parchment and hide the text boxes above dotted lines on a piece of paper so it looks like you're signing in... The login details could be entered into the string fields of a block... suggestions, thoughts?

IMO, first let's get it working, then worry about design.

Offline

 

#1025 2012-04-21 15:52:55

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

Re: Welcome to your local block library! - Website development thread.

Greenatic wrote:

sparks wrote:

I want to avoid an infinite loop, but certainly several tries is possible and may solve the problem...

Does anyone have any ideas for a library-themed login box? There are a few ideas I have but IDK how good they would look. You could just have a normal login box with a wood background, you could have parchment and hide the text boxes above dotted lines on a piece of paper so it looks like you're signing in... The login details could be entered into the string fields of a block... suggestions, thoughts?

IMO, first let's get it working, then worry about design.

+1

Offline

 

Board footer