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

#26 2011-08-19 16:42:18

Barf_Bag
Scratcher
Registered: 2011-07-10
Posts: 100+

Re: bbcode for your sites - collaberative php coding

This looks really nice! I can't wait to see it complete!  big_smile


http://i56.tinypic.com/33tiavp.png

Offline

 

#27 2011-08-19 16:46:09

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

hey, sparks. maybe you could add your suggestions to the Scratch Forum BBcode to this one.  big_smile

Offline

 

#28 2011-08-19 16:49:15

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

Re: bbcode for your sites - collaberative php coding

Took the liberty of adding a

Code:

$string = preg_replace('#\[color=([^\[]+?)\](.*?)\[/color\]#', "<font color=\"$1\">$2</font>", $string); #font colour tag

font colour tag. Could you maybe explain what these lines are doing, LS97? Cos if I'm honest I just guessed my way through that...


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

Offline

 

#29 2011-08-19 17:02:15

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks wrote:

Took the liberty of adding a

Code:

$string = preg_replace('#\[color=([^\[]+?)\](.*?)\[/color\]#', "<font color=\"$1\">$2</font>", $string); #font colour tag

font colour tag. Could you maybe explain what these lines are doing, LS97? Cos if I'm honest I just guessed my way through that...

lol
I'm still a bit confused. I've read a php book with a whole chapter on that stuff, but never got it.  tongue

It does work, though.

Last edited by ProgrammingFreak (2011-08-19 17:03:12)

Offline

 

#30 2011-08-19 17:08:49

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks, what did you use to create accidental games website?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#31 2011-08-19 17:28:05

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks, the second to last FAQ has a grammatical error.  tongue  It says 'their' and is supposed to be 'they're' or 'they are'. Just thought you would want to know.  tongue

Offline

 

#32 2011-08-19 17:48:06

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

Re: bbcode for your sites - collaberative php coding

WindowsExplorer wrote:

sparks, what did you use to create accidental games website?

I used notepad++ and two months  tongue  All the graphics and code were done by my friend "crazyman47" and myself!

programmingFreak wrote:

sparks, the second to last FAQ has a grammatical error.  tongue  It says 'their' and is supposed to be 'they're' or 'they are'. Just thought you would want to know.

Sorry, does it? Are you just misreading or not getting the joke?

Last edited by sparks (2011-08-19 17:51:19)


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

Offline

 

#33 2011-08-19 17:51:54

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

notepad++ isn't a website maker.


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#34 2011-08-19 17:54:31

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

Re: bbcode for your sites - collaberative php coding

No. No it's not. It is a text editor. I didn't use a website maker, I physically wrote all the code for the website by hand, using notepad++ as a writer.


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

Offline

 

#35 2011-08-19 17:56:53

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

how did you make the custom url then?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#36 2011-08-19 17:59:51

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

Re: bbcode for your sites - collaberative php coding

Do you mean the web address accidentalgames.com? I bought it.


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

Offline

 

#37 2011-08-19 18:02:51

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

With what?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#38 2011-08-19 18:04:13

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

Re: bbcode for your sites - collaberative php coding

... money?


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

Offline

 

#39 2011-08-19 18:05:29

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

I mean, what host did you use?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#40 2011-08-19 18:06:47

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks wrote:

programmingFreak wrote:

sparks, the second to last FAQ has a grammatical error.  tongue  It says 'their' and is supposed to be 'they're' or 'they are'. Just thought you would want to know.

Sorry, does it? Are you just misreading or not getting the joke?

Its in the question.
But you guys are random and funny.  big_smile

Offline

 

#41 2011-08-19 18:10:10

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

Re: bbcode for your sites - collaberative php coding

Haha, thanks PF, That's what we're aiming for!

The question was deliberately grammatically incorrect for the answer to make sense  smile

WindowsExplorer, I'm not putting the webhost's name here as it's potentially a security issue, but I used to use 000webhost as a host and they were okay, if you're looking to buy a domain  smile


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

Offline

 

#42 2011-08-19 18:11:39

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

They use Hosting24.com.

sparks, are you going to make functions that you wanted to have here? Like Center.

Offline

 

#43 2011-08-19 18:11:59

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

How do you insert php into a website on 000webhost?


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#44 2011-08-19 18:15:01

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

Re: bbcode for your sites - collaberative php coding

The file needs to be a .php file, so index.php would be your homepage filename. Then you insert php into the file using the <?php and ?> tags.


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

Offline

 

#45 2011-08-19 18:17:30

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

Re: bbcode for your sites - collaberative php coding

ProgrammingFreak wrote:

sparks, are you going to make functions that you wanted to have here? Like Center.

Pardon? I'm planning to use this bbcode system with my commenting, yes. Is that what you meant? Or do you mean the bbcode functions that I wanted in the Scratch fora? If so, probably not as I don't really need them on my site... It might be nice to add the to the open-source one though in order to keep the option open for others' use  smile


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

Offline

 

#46 2011-08-19 18:18:43

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

you should put youtube tags and google tags, so the link goes to a google search page


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#47 2011-08-19 18:19:25

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks wrote:

ProgrammingFreak wrote:

sparks, are you going to make functions that you wanted to have here? Like Center.

Pardon? I'm planning to use this bbcode system with my commenting, yes. Is that what you meant? Or do you mean the bbcode functions that I wanted in the Scratch fora? If so, probably not as I don't really need them on my site... It might be nice to add the to the open-source one though in order to keep the option open for others' use  smile

I was talking about the latter.

I also noticed that when I click 'Comic' in the navigation section, it goes to

http://accidentalgames.com/comics.php

without the id, which leads to an error.  smile

Am I being annoying?  sad

Offline

 

#48 2011-08-19 18:23:33

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

Re: bbcode for your sites - collaberative php coding

No, that's an error I have yet to fix. Try using the direction arrows or adding id=1 to the url (warning, content is both mature and not very good - we're planning to completely redo them at some point) (the comics page has to be the least complete one  tongue  )

Last edited by sparks (2011-08-19 18:26:53)


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

Offline

 

#49 2011-08-19 18:33:02

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks wrote:

No, that's an error I have yet to fix. Try using the direction arrows or adding id=1 to the url (warning, content is both mature and not very good - we're planning to completely redo them at some point) (the comics page has to be the least complete one  tongue  )

Yeah, I noticed that.  tongue

Offline

 

#50 2011-08-20 05:22:32

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: bbcode for your sites - collaberative php coding

sparks wrote:

Took the liberty of adding a

Code:

$string = preg_replace('#\[color=([^\[]+?)\](.*?)\[/color\]#', "<font color=\"$1\">$2</font>", $string); #font colour tag

font colour tag. Could you maybe explain what these lines are doing, LS97? Cos if I'm honest I just guessed my way through that...

Oooh, CTRL+I opens the developer window in chrome. Anyway let me try the typing again:

I can see you guessed your way through that, it's not too optimal either  tongue  REGEX is just a matter of experience and randomness really, it's not something I learned using a manual. Of course the basics have to be there in the first place. But Wikipedia did a great job with that.

as for the color/colour tag, we know that we're looking for either some letters (a-z, A-Z) or # followed by numbers. Nothing else. So we can use:

Code:

$string = preg_replace('#\[color=([a-zA-Z]*|#[0-9]*)\](.*?)\[/color\]#', "<span style=\"color: $1\">$2</font>", $string); #font colour tag

Oh, and the font tag is obsolete. Better use a span with CSS styling like I did. Now, let me test that...

Don't use that code. It temporarily sucks.
Please view next post by me, first on P.3

Last edited by LS97 (2011-08-20 05:30:03)

Offline

 

Board footer