I've finished! http://scratch.mit.edu/forums/viewtopic.php?id=69732
Any suggestions are welcome
Offline
Sooo, I haven't followed this topic. What's been happening?
Offline
Offline
Awesome!
Offline
Thanks coolstuff! It's a great honour to have a I-Topic in my name and I hope I can continue developing this!!! What's going on about that laman's guide? Am I writing that or are one of your mods working on one for FAQ?
Offline
SeptimusHeap wrote:
Sooo, I haven't followed this topic. What's been happening?
Offline
SeptimusHeap wrote:
Sooo, I haven't followed this topic. What's been happening?
Well, the topic has been i-topic'd, sparks has added full text rendering with many customiseable options.
Offline
I'm wondering comp500 how much of the api you've put into the generator, so I can start with putting more things in
Offline
I've just kitted out my TBG The 3DS Championships with the online/offline indicators. If the user is online, the 3DS image is open and black, if their offline, it's closed and blue. It works really well!
And in case anyone wants to know, I suggested this to be ITopic'd.
Offline
Another example of the API is here: http://scratch.mit.edu/forums/viewtopic … 32&p=1
Offline
Yes, I saw, that's not the API though. API stands for application program interface and from what I understand about it, it does not store information. Rum's like button system is something he's been working on seperately
Offline
sparks wrote:
Yes, I saw, that's not the API though. API stands for application program interface and from what I understand about it, it does not store information. Rum's like button system is something he's been working on seperately
Yeh it's not an api as it doesn't get any information from the scratch forums at all other than it checks a few things to make sure a page exists there.
Offline
sparks wrote:
Hmmm, I can't find anywhere on the fora or the Scratch API that shows the number of posts of each user... The way it's looking the post counter would need the user name and a link to a page on which they have posted... Anyone seen anywhere that shows the number of person (n)'s posts other than beside the posts?
Well, you could use the search page to look for a post by them, then get the number of posts from there...
Offline
RUMCH's system works really well -- all it needs IMO is a slight graphic improvement.
Coming soon, it's going to take a slight while.
Offline
scimonster wrote:
sparks wrote:
Hmmm, I can't find anywhere on the fora or the Scratch API that shows the number of posts of each user... The way it's looking the post counter would need the user name and a link to a page on which they have posted... Anyone seen anywhere that shows the number of person (n)'s posts other than beside the posts?
Well, you could use the search page to look for a post by them, then get the number of posts from there...
A bit of a hard workaround, but maybe possible. There must be something easier, maybe ask the user to link a post...
Offline
OK, here's my graphical improvement to RUMCHEE's +1/Like thing:
Obviously that's my post count and not a like button (I wish). Anyway, if you like the concept I can give you the source for creating the image as it is there.
Offline
I can see improvements to be made to the background but source would be appreciated to modify, I'm assuming that it uses a separate picture for the background? Because if so I will change it as I feel it could be slightly better (only slightly, still better than the current one )
Last edited by RUMCHEERYPOOPOO (2011-07-27 10:49:51)
Offline
RUMCHEERYPOOPOO wrote:
I can see improvements to be made to the background but source would be appreciated to modify, I'm assuming that it uses a separate picture for the background? Because if so I will change it as I feel it could be slightly better (only slightly, still better than the current one )
Sure!
Image:
PHP Code just for image + text (add a $text = number of likes)
// add background image and set gray font color
$img = imagecreatefrompng ( "postLikeCntB.png" );
$text_colour = imagecolorallocate( $img, 210, 210, 210 );
// add text
$font = realpath('font.ttf');
imagettftext($img, 13, 0, 28, 24, $text_colour, $font, '+' . $text);
// this isneeded to remove background,
// maybe something neater = better but had no time to try
$whit = imagecolorallocate($img, 255, 255, 255);
imagecolortransparent($img, $whit);
// set content + create image
header( 'Content-type: image/png' );
imagepng( $img );
//destroy resources
imagecolordeallocate( $text_color );
imagedestroy( $img );
I just realized I completely disregarded the unlike button -- maybe make it a plus to like, and a minus to unlike?
so, 20 likes: < (+20)
when liked: < (-20)
it's just an idea.
(on a sidenote, ) -.-
Last edited by LS97 (2011-07-27 11:10:56)
Offline
Testing the indicator...
It worked!
This is pretty cool. I like this.
Last edited by videogame9 (2011-07-27 11:46:52)
Offline
LS97 wrote:
RUMCHEERYPOOPOO wrote:
I can see improvements to be made to the background but source would be appreciated to modify, I'm assuming that it uses a separate picture for the background? Because if so I will change it as I feel it could be slightly better (only slightly, still better than the current one )
Sure!
Image:
http://mod-share.webuda.com/imgs/posts/postLikeCntB.png
PHP Code just for image + text (add a $text = number of likes)// add background image and set gray font color
$img = imagecreatefrompng ( "postLikeCntB.png" );
$text_colour = imagecolorallocate( $img, 210, 210, 210 );
// add text
$font = realpath('font.ttf');
imagettftext($img, 13, 0, 28, 24, $text_colour, $font, '+' . $text);
// this isneeded to remove background,
// maybe something neater = better but had no time to try
$whit = imagecolorallocate($img, 255, 255, 255);
imagecolortransparent($img, $whit);
// set content + create image
header( 'Content-type: image/png' );
imagepng( $img );
//destroy resources
imagecolordeallocate( $text_color );
imagedestroy( $img );I just realized I completely disregarded the unlike button -- maybe make it a plus to like, and a minus to unlike?
so, 20 likes: < (+20)
when liked: < (-20)
it's just an idea.
(on a sidenote, http://scratchloveit.netne.net/topicrat … ;ret=image) -.-
Regarding your sidenote, this doesn't work because you tried adding a like button about a post, it only works for topics (the things that show on the advanced forums list).
Edit: Thanks for the code by the way, I'm changing the picture to give it a more 'scratchy' feel!
Last edited by RUMCHEERYPOOPOO (2011-07-27 12:16:45)
Offline
RUMCHEERYPOOPOO wrote:
LS97 wrote:
RUMCHEERYPOOPOO wrote:
I can see improvements to be made to the background but source would be appreciated to modify, I'm assuming that it uses a separate picture for the background? Because if so I will change it as I feel it could be slightly better (only slightly, still better than the current one )
Sure!
Image:
http://mod-share.webuda.com/imgs/posts/postLikeCntB.png
PHP Code just for image + text (add a $text = number of likes)// add background image and set gray font color
$img = imagecreatefrompng ( "postLikeCntB.png" );
$text_colour = imagecolorallocate( $img, 210, 210, 210 );
// add text
$font = realpath('font.ttf');
imagettftext($img, 13, 0, 28, 24, $text_colour, $font, '+' . $text);
// this isneeded to remove background,
// maybe something neater = better but had no time to try
$whit = imagecolorallocate($img, 255, 255, 255);
imagecolortransparent($img, $whit);
// set content + create image
header( 'Content-type: image/png' );
imagepng( $img );
//destroy resources
imagecolordeallocate( $text_color );
imagedestroy( $img );I just realized I completely disregarded the unlike button -- maybe make it a plus to like, and a minus to unlike?
so, 20 likes: < (+20)
when liked: < (-20)
it's just an idea.
(on a sidenote, http://scratchloveit.netne.net/topicrat … ;ret=image) -.-Regarding your sidenote, this doesn't work because you tried adding a like button about a post, it only works for topics (the things that show on the advanced forums list).
Edit: Thanks for the code by the way, I'm changing the picture to give it a more 'scratchy' feel!
ok great!!
Offline
Oh, LS97, I've sofar failed to get the bgimage version working can you see what's wrong?:
<?PHP //parser in spaces $count = 1; $string = str_replace("_"," ",$_GET['string']); if(isset($_GET['bgimage'])){ #thanks to LS97 for making most of the bgimage attribute! // create the background $img = imagecreatefrompng($_GET['bgimage']); //chooses the text color if(isset($_GET['textr']) | isset($_GET['textg']) | isset($_GET['textb'])){ $red = (int)$_GET['textr']; $green = (int)$_GET['textg']; $blue = (int)$_GET['textb']; $color = imagecolorallocate($img, $red, $blue, $green); } else{ $text_colour = imagecolorallocate($img, 0, 0, 0); } // get the font -- it's a truetype font, you probably need that as opposed to a bitmap font $font = realpath('http://www.blocks.scratchr.org/fonts/Trebuchet_MS.ttf'); // print the string imagettftext($img, 13, 0, 15, 35, $text_colour, $font, $string); // tell browser about content type header( 'Content-type: image/png' ); // create image imagepng( $img ); } if(!isset($_GET['bgimage'])){ // Set font size $font_size = 2; if(isset($_GET['font_size'])){ $font_size = $_GET['font_size']; } $font = '/fonts/Trebuchet_MS.ttf'; if(isset($_GET['font'])){ $font = $_GET['font']; } // Create image width dependant on width of the string $width = imagefontwidth($font_size)*strlen($string); if(isset($_GET['width'])){ $width = $_GET['width']; } // Set height to that of the font $height = imagefontheight($font_size); if(isset($_GET['height'])){ $height = $_GET['height']; } // Create the image pallette $img = imagecreate($width,$height); if(isset($_GET['bgr']) | isset($_GET['bgg']) | isset($_GET['bgb'])){ $red = (int)$_GET['bgr']; $blue = (int)$_GET['bgg']; $green = (int)$_GET['bgb']; $bg = imagecolorallocate($img, $red, $blue, $green); } else{ $bg = imagecolorallocate($img, 222, 223, 223); } // Font color if(isset($_GET['textr']) | isset($_GET['textg']) | isset($_GET['textb'])){ $red = (int)$_GET['textr']; $green = (int)$_GET['textg']; $blue = (int)$_GET['textb']; $color = imagecolorallocate($img, $red, $blue, $green); } else{ $color = imagecolorallocate($img, 0, 0, 0); } // Length of the string if(isset($_GET['limitstring'])){ if(strlen($string) > $_GET['limitstring']){ $string= substr($string, 0, $_GET['limitstring']); } } $len = strlen($string); // Y-coordinate of character, X changes, Y is static $ypos = 0; if(isset($_GET['ypos'])){ $ypos = $_GET['ypos']; } // Loop through the string for($i=0;$i<$len;$i++){ // Position of the character horizontally if(isset($_GET['xpos'])){ $xpos = $i * imagefontwidth($font_size) + $_GET['xpos']; } else{ $xpos = $i * imagefontwidth($font_size); } // Draw character imagechar($img, $font_size, $xpos, $ypos, $string, $color); // Remove character from string $string = substr($string, 1); } // Return the image header("Content-Type: image/gif"); imagegif($img); } // Remove image imagedestroy($img); ?>
Offline
^^ I'll do my best! Expect an answer within the following 15/20 minutes, if i don't reach my 200mb limit before that.
EDIT
good, 70MB left. and as for the problem, found out that the path given to images is not a valid one. let me try to fix that (it's the only error, the other 4 are all depending on it)
Last edited by LS97 (2011-07-27 13:02:28)
Offline