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

#401 2011-07-28 06:24:05

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

http://blocks.scratchr.org/textrender.php?string=Nuclear_Launch_Detected.&bgimage=http://4.bp.blogspot.com/-VT9-iZgON1c/TgDA0YOspqI/AAAAAAAAHtI/PPmevY6T-K4/s1600/Nuclear%2BLaunch%2BDetected.png

Last edited by bbbeb (2011-07-28 06:24:39)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#402 2011-07-28 06:26:27

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

Re: ITopic: self-updating images and links in posts!

bbbeb wrote:

http://blocks.scratchr.org/textrender.php?string=Nuclear_Launch_Detected.&bgimage=http://4.bp.blogspot.com/-VT9-iZgON1c/TgDA0YOspqI/AAAAAAAAHtI/PPmevY6T-K4/s1600/Nuclear%2BLaunch%2BDetected.png

I think this is an example of where font-size would be a hand attribute!


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

Offline

 

#403 2011-07-28 06:36:31

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

Re: ITopic: self-updating images and links in posts!

sparks wrote:

I think this is an example of where font-size would be a hand attribute!

I didn't even notice the tiny text in the top!

Offline

 

#404 2011-07-28 06:44:33

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

Re: ITopic: self-updating images and links in posts!

Yeah, me neither at first  tongue  Phwooo, I'm working my way through C++ at the moment. It's a lot to take in though thankfully it's very similar to PHP.


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

Offline

 

#405 2011-07-28 06:44:54

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

I think this is an example of where font-size would be a hand attribute!

Strange, because the code that LS97 gave me enabled me to change the font size. If you take a look at the function he uses to make the image http://php.net/manual/en/function.imagettftext.php then it says that the second parameter is the font size, so if you have that as a variable in the code, it should work. It did for me!

Edit: Php and C++ are incredibly similar!

Last edited by RUMCHEERYPOOPOO (2011-07-28 06:45:38)


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#406 2011-07-28 07:07:24

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

Re: ITopic: self-updating images and links in posts!

Thanks for pointing it out, Rum, I didn't spot the font attribute as it was just a number, so I had to look the function up to see that it was the font size  wink

http://blocks.scratchr.org/textrender.php?font_size=30&string=Bigger_font!&bgimage=http://www.wastepapersolutions.co.uk/ESW/Images/bluesquare.png&xpos=45&ypos=150


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

Offline

 

#407 2011-07-28 07:09:56

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Thanks for pointing it out, Rum, I didn't spot the font attribute as it was just a number, so I had to look the function up to see that it was the font size  wink

http://blocks.scratchr.org/textrender.p … p;ypos=150

your welcome!


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#408 2011-07-28 07:14:17

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

Re: ITopic: self-updating images and links in posts!

I may actually be able to apply font options to both textreturns now... though from what I understand fonts don't work outside the same directory?

$font = realpath('Trebuchet_MS.ttf');

Looking up realpath()...

It appears to swap /'s with \'s. So that's annoying....

Last edited by sparks (2011-07-28 07:16:49)


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

Offline

 

#409 2011-07-28 07:16:39

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

I may actually be able to apply font options to both textreturns now... though from what I understand fonts don't work outside the same directory?

$font = realpath('Trebuchet_MS.ttf');

Looking up realpath()...

I think the font has to be on the same server as the php file, as the realpath finds the path to it on the server, for example on a linux server the real path would be something like '/var/www/public_html/font.ttf' (root of the webserver in many cases.)


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#410 2011-07-28 07:17:44

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

Re: ITopic: self-updating images and links in posts!

RUMCHEERYPOOPOO wrote:

sparks wrote:

I may actually be able to apply font options to both textreturns now... though from what I understand fonts don't work outside the same directory?

$font = realpath('Trebuchet_MS.ttf');

Looking up realpath()...

I think the font has to be on the same server as the php file, as the realpath finds the path to it on the server, for example on a linux server the real path would be something like '/var/www/public_html/font.ttf' (root of the webserver in many cases.)

Hmmm, I suppose I could support a few common fonts on the server, but I don't want to clog it up, it does belong to the Scratch team, after all...

It looks like php actually has five built-in fonts...

Last edited by sparks (2011-07-28 07:20:13)


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

Offline

 

#411 2011-07-28 07:20:02

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

RUMCHEERYPOOPOO wrote:

sparks wrote:

I may actually be able to apply font options to both textreturns now... though from what I understand fonts don't work outside the same directory?

$font = realpath('Trebuchet_MS.ttf');

Looking up realpath()...

I think the font has to be on the same server as the php file, as the realpath finds the path to it on the server, for example on a linux server the real path would be something like '/var/www/public_html/font.ttf' (root of the webserver in many cases.)

Hmmm, I suppose I could support a few common fonts on the server, but I don't want to clog it up, it does belong to the Scratch team, after all...

You could have serif, sans-serif, console and decorative.


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#412 2011-07-28 07:22:35

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

Re: ITopic: self-updating images and links in posts!

It may be hard not to get carried away...


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

Offline

 

#413 2011-07-28 07:35:40

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

It may be hard not to get carried away...

lol I suggest you use some of the ones from this list: http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html

Arial, Comic Sans MS, Courier New, Georgia and Impact.


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#414 2011-07-28 11:47:42

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

Re: ITopic: self-updating images and links in posts!

Hmmm, it's looking like I can't apply fonts to the standard single-colour imagereturn. The background image fits itself to the size of the text (unless otherwise specified). If I added fonts I don't think it could calcualte that any more and there would be all sorts of problems... Prove me wrong if you can, world  hmm


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

Offline

 

#415 2011-07-28 11:51:13

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Hmmm, it's looking like I can't apply fonts to the standard single-colour imagereturn. The background image fits itself to the size of the text (unless otherwise specified). If I added fonts I don't think it could calcualte that any more and there would be all sorts of problems... Prove me wrong if you can, world  hmm

The world says: "You can but not as well as you can with the default font"


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#416 2011-07-28 12:32:33

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Hmmmm this gives me an idea, would it be possible for you to make an api which would check who is logged onto the scratch website? Then you could make a note seem personal for that person so your forum could be different for each person. Could you make it? Do you know what I am talking about? If not, wait till I am done with my vacation. XD



YouAreAwsomeSparks!YouShowedUsHowToSaveSpacesAndNowThis!LOLXD

Last edited by Pecola1 (2011-07-28 12:34:26)


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#417 2011-07-28 12:40:05

RUMCHEERYPOOPOO
Scratcher
Registered: 2008-12-23
Posts: 100+

Re: ITopic: self-updating images and links in posts!

Pecola1 wrote:

Hmmmm this gives me an idea, would it be possible for you to make an api which would check who is logged onto the scratch website? Then you could make a note seem personal for that person so your forum could be different for each person. Could you make it? Do you know what I am talking about? If not, wait till I am done with my vacation. XD



YouAreAwsomeSparks!YouShowedUsHowToSaveSpacesAndNowThis!LOLXD

Essentially, no.


I AM ROOKWOOD101 NOW! (just so you know)

Offline

 

#418 2011-07-28 13:14:06

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

Re: ITopic: self-updating images and links in posts!

Save spaces? As in reserved posts?

It would be possible if the Scratch team allowed the API to read the session variable of the viewer, but I doubt they would let that happen; it's probably against their privacy policy, I could technically do it with IP addresses but then you would need to know the IP for each person you wish to personalise the message for.

Furthermore, how on earth would moderators keep track of bullying sigs that target just one person?! It's a nice idea though  smile


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

Offline

 

#419 2011-07-28 13:18:15

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Save spaces? As in reserved posts?

It would be possible if the Scratch team allowed the API to read the session variable of the viewer, but I doubt they would let that happen; it's probably against their privacy policy, I could technically do it with IP addresses but then you would need to know the IP for each person you wish to personalise the message for.

Furthermore, how on earth would moderators keep track of bullying sigs that target just one person?! It's a nice idea though  smile

XD That would be hard for moderators, but couldn't you make it by having it read the url of the scratch website and seeing who is logged in? I don't know anything about making an api, could you read a url from that browser?


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#420 2011-07-28 13:24:15

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: ITopic: self-updating images and links in posts!

Wait... using this method can you make a sig to be different for certain forums?


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#421 2011-07-28 13:31:46

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

Re: ITopic: self-updating images and links in posts!

There is no "currently online" on the main site for me to pull from. There is "5 most-recent visitors" but that's not much use.

And no, unfortunately the API can't tell where it is being displayed, though you may be able to do it using the target function on the online/offline bit. The the sig can show one thing when you're on the tbg and another when you're on the main forum.


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

Offline

 

#422 2011-07-28 13:49:55

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

Re: ITopic: self-updating images and links in posts!

RememberYour"SaveTheSpaces"Sig?

Offline

 

#423 2011-07-28 15:06:43

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

Re: ITopic: self-updating images and links in posts!

Oh, yes! ITotallyForgotAboutThatOne.They recently worked out that you could just chop up tabs and get a couple of spaces that way. It means a lot of paperwork but no-one notices the difference and it neutralised the problem for the time being. I believe there's a hefty reward for space mines all the same, so keep your eye out for little bits of stuff you can't see in the soil, there may be one nearby! We're too young to be paying taxes but I believe our parents are becoming rather fond of camelCase to cut down on their monthly grammar bill.


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

Offline

 

#424 2011-07-28 15:15:36

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

Re: ITopic: self-updating images and links in posts!

sparks wrote:

Save spaces? As in reserved posts?

It would be possible if the Scratch team allowed the API to read the session variable of the viewer, but I doubt they would let that happen; it's probably against their privacy policy, I could technically do it with IP addresses but then you would need to know the IP for each person you wish to personalise the message for.

Furthermore, how on earth would moderators keep track of bullying sigs that target just one person?! It's a nice idea though  smile

Aaahh!!! You just gave me an idea!!
Don't worry, nothing malicious. But sparks, you'll probably be seeing news from me in my sig.

Offline

 

#425 2011-07-28 15:24:21

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

Re: ITopic: self-updating images and links in posts!

RUMCHEERYPOOPOO wrote:

sparks wrote:

A lot of programmers are self-taught so they just do what works. It's like when johnnydean1 would get a block to work using about 50 lines and then it turns out nXIII knew a commands to do exactly that and cut it down to three. You could always try and develop your own generator if you wanted to have a go?

I think I'll wait until I've cut down on the todo list for the like buttons a bit more, as it's quite a big job making a generator for it, and I commend what comp has done.

I couldn't have said it better myself. comp's put a lot of effort into the project.

and sparks, that's too true. That's what my 600 page C++ manual is for... but coding is more fun when it's yours. Still, there's a limit to craziness: I try to comment my code also for later use.

Offline

 

Board footer