sparks wrote:
Right, I've fixed the content type for image returns so you can click "view image" and you'll see the picture, not a load of gobbledygook! (wow, seriously? My spell-checker recognises 'gobbledygook' but not 'altogether'? ... anyway) Adding the content type to the entire API, I found, broke all the link attributes taking you to another page so I had to manually put it in several times, but I suppose it's worth it, thanks LS97 for the incredibly big hint that I'd missed that
Do you use chrome? I think Chrome's the one that doesn't recognize altogether -- I've had the exact same problem before (well, not with the gobble stuff). But yeah, add to dictionary.
What do you mean broke all the link attribs?
Offline
nathanprocks wrote:
sparks wrote:
How odd! Normal sized for me! I have no idea what's causing it
i think it just depends on what computer/browser you are using. when i am using a public computer with Internet Explorer 8, it shows the images very big like that. when i am on my laptop with Chrome, it shows the images as its normal size.
I'm wondering if maybe there's some sort of resize command/header we could add in -- It's weird though, 'cause it should set the size to the original image's size... I'll investigate.
Offline
^ a resize attribute would actually be a really useful thing for the API, letting users make the icons for their projects smaller to fit the sig, for example. When I looked into this the only way I could see it working was to get the original image, then physically save an edited (resized) version of it to the host site's files, then get that, then delete it.
*guilty face* I've never actually looked to see if my API works in anything but Firefox. Usually when I work on a website I test it in all major browsers but since this contains no HTML I didn't think it necessary...
Last edited by sparks (2011-08-13 15:22:48)
Offline
sparks wrote:
^ a resize attribute would actually be a really useful thing for the API, letting users make the icons for their projects smaller to fit the sig, for example. When I looked into this the only way I could see it working was to get the original image, then physically save an edited (resized) version of it to the host site's files, then get that, then delete it.
*guilty face* I've never actually looked to see if my API works in anything but Firefox. Usually when I work on a website I test it in all major browsers but since this contains no HTML I didn't think it necessary...
A resize attribute would be great! I suggest you look into the Imagick class (there should be some tutorials on php.net). It has really useful methods.
EDIT
By the way, if you have no idea how to use it, welcome to the club
Last edited by LS97 (2011-08-13 16:05:55)
Offline
So... would I be able to make text showing the title of my newest game, with the thumbnail image of it in the background?
Offline
floppy_gunk wrote:
So... would I be able to make text showing the title of my newest game, with the thumbnail image of it in the background?
You can already, partially! The good thing about this stuff is that it's recursive. Just tinyURL the URL of the project background, then wait until we make another little feature. Then you can tinyURL the URL for the latest project name, and add it into the custom text creator (the one I coded, to be clear).
Yeah, that wasn't clear at all. Basically no, but you will soon enough.
Offline
In IE, it's disgustingly huge.
Offline
http://www.php.net/manual/en/function.i … eimage.php
I'm currently testing this out. Maybe this is what we could use.
Offline
ProgrammingFreak wrote:
http://www.php.net/manual/en/function.i … eimage.php
I'm currently testing this out. Maybe this is what we could use.
That's cool! Didn't exactly know how to use it, but now I noticed the example
Looking forward to result!
Offline
LS97 wrote:
ProgrammingFreak wrote:
http://www.php.net/manual/en/function.i … eimage.php
I'm currently testing this out. Maybe this is what we could use.That's cool! Didn't exactly know how to use it, but now I noticed the example
Looking forward to result!
<?php header('Content-type: image/jpeg'); $image = new Imagick('test.jpg'); $image->adaptiveResizeImage(634,768); echo $image; ?>
Using Image:
[img]tinyurl.com/3px3a4x[/img]
Gives:
The image “http://localhost/resize.php” cannot be displayed, because it contains errors.
-_-
Last edited by ProgrammingFreak (2011-08-17 14:14:03)
Offline
Maybe this is better: http://www.php.net/manual/en/function.i … limage.php
Offline
sparks wrote:
I just got accepted into the university I applied for today!
Congrats!
Offline
sparks wrote:
I just got accepted into the university I applied for today!
Yay! But tell me, what does this have to do with "self-updating images and links in posts"?
Offline
sparks wrote:
I just got accepted into the university I applied for today!
Wow, congratulations!
Offline
I'm back from holiday! Not that I told any of you that I went on holiday... But, I did. Anyway, what progress has been made since I was last here?
Offline
So. Coolstuff was looking for (and I agree) a simpler tutorial for using the API in posts and sigs than the detailed documentation you currently have to read through. Would anyone be interested in writing some bits explaining easily how to use aspects of the API and put them together?
Offline
sparks wrote:
So. Coolstuff was looking for (and I agree) a simpler tutorial for using the API in posts and sigs than the detailed documentation you currently have to read through. Would anyone be interested in writing some bits explaining easily how to use aspects of the API and put them together?
I could.
Offline
sparks wrote:
So. Coolstuff was looking for (and I agree) a simpler tutorial for using the API in posts and sigs than the detailed documentation you currently have to read through. Would anyone be interested in writing some bits explaining easily how to use aspects of the API and put them together?
Great idea!!
And, by the way, how's comp's JS SDK doing?
Offline
I did the online/offline detector:
I'm glad that you're interested in using the Scratch API. We will have quite the adventure. But maybe you're new at all this PHP stuff and need a little guidence on what to do.
Well you've come to the right place.
1 Offline/Online Detector
With this device you will be able to tell if a user is online or not. This is really simple. In a image tag, instead of linking to an image, you link to the api:Code:
[img]http://blocks.scratchr.org/API.php[/img]But thats not all. You add a
Code:
?user=USERNAME&action=onlineStatusTo the end of that url. With this code, you can have an image of a green/gray dot to tell if you are online or not.
But wait, there is still more!
Maybe you think the image you have is boring, and you want something different. Well, you are not alone.
All you have to do is add aCode:
&type=to the end of the url and your possibilies extend even further!
Here are your options:
A square button:Code:
&type=squareText:
Code:
&type=textYou can even do your own image! To do so, add:
Code:
&online=URLOFIMAGEFORONLINE&offline=URLOFIMAGEFOROFFLINEYou are probably thinking, "Wow. Thats so long I'll never understand it!". But I can help you with it!
Lemme break it down to you:
First, we add the username:Code:
user=USERNAMEThen we add the action:
Code:
&action=onlineStatusRemember, we've done this before. So don't sweat it!
Next we add the image to show when the user is online:Code:
&online=URLOFIMAGEFORONLINEFinally we add the image to show when the user is offline:
Code:
&offline=URLOFIMAGEFOROFFLINE(remember to fill in the actual urls for this to work)
And you're done! Enjoy your offline/online detector!
Last edited by ProgrammingFreak (2011-08-27 08:39:36)
Offline
sparks, I was thinking that to make the API use easier you could do some regex replacements in .HTACCESS.
Like Scratch did in their API: "http://scratch.mit.edu/api/getproject/" does not have a directory for each project, but rather uses HTACCESS to replace some GET variable with a fake directory.
Offline
Hey, is there a way to get a users favorites?
Offline