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

#1 2011-08-11 17:48:18

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Post Count?

Is there a way to display one's post count, like in the sig or something?

Sorta like how there's the offline/online thing?

Offline

 

#2 2011-08-11 17:58:33

Qwiffles
Scratcher
Registered: 2011-07-13
Posts: 100+

Re: Post Count?

kayybee?  In Advanced Topics?  yikes   tongue

Lol, maybe you should ask sparks?


Don't feed a pet troll.  It will turn evil.

Offline

 

#3 2011-08-12 11:16:26

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Post Count?

Qwiffles wrote:

kayybee?  In Advanced Topics?  yikes   tongue

Lol, maybe you should ask sparks?

What? I check here sometimes... But I rarely post.

Offline

 

#4 2011-08-12 11:29:36

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Post Count?

look here maybe: http://scratch.mit.edu/forums/viewtopic.php?pid=838568#p838568

Offline

 

#5 2011-08-12 14:31:36

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

Re: Post Count?

It's possible (I have it in my sig), but it can't be automated for good reasons.
So you have to code it yourself in PHP and no one can help you  wink

Offline

 

#6 2011-08-13 09:12:01

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

Re: Post Count?

LS97 wrote:

It's possible (I have it in my sig), but it can't be automated for good reasons.
So you have to code it yourself in PHP and no one can help you  wink

Well, Daffy22 could help, but I don't see him around lately...  sad

Offline

 

#7 2011-08-13 09:53:18

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

Re: Post Count?

ProgrammingFreak wrote:

LS97 wrote:

It's possible (I have it in my sig), but it can't be automated for good reasons.
So you have to code it yourself in PHP and no one can help you  wink

Well, Daffy22 could help, but I don't see him around lately...  sad

I could help too  roll  but it's not something that can be standardized.

Offline

 

#8 2011-08-13 09:55:39

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

Re: Post Count?

LS97 wrote:

ProgrammingFreak wrote:

LS97 wrote:

It's possible (I have it in my sig), but it can't be automated for good reasons.
So you have to code it yourself in PHP and no one can help you  wink

Well, Daffy22 could help, but I don't see him around lately...  sad

I could help too  roll  but it's not something that can be standardized.

yeah.  tongue  Thats true. I have a copy of the code somewhere....hmm...

Offline

 

#9 2011-08-13 10:05:36

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

Re: Post Count?

ProgrammingFreak wrote:

LS97 wrote:

ProgrammingFreak wrote:


Well, Daffy22 could help, but I don't see him around lately...  sad

I could help too  roll  but it's not something that can be standardized.

yeah.  tongue  Thats true. I have a copy of the code somewhere....hmm...

Guess what me too...  tongue

Offline

 

#10 2011-08-13 10:30:09

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

Re: Post Count?

LS97 wrote:

ProgrammingFreak wrote:

LS97 wrote:


I could help too  roll  but it's not something that can be standardized.

yeah.  tongue  Thats true. I have a copy of the code somewhere....hmm...

Guess what me too...  tongue

I know.  tongue

Offline

 

#11 2011-08-13 10:45:02

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

Re: Post Count?

ProgrammingFreak wrote:

LS97 wrote:

ProgrammingFreak wrote:


yeah.  tongue  Thats true. I have a copy of the code somewhere....hmm...

Guess what me too...  tongue

I know.  tongue

Except I can't find it and also I don't want to use all the bandwidth because I'm download a 500MB linux distro  tongue

Offline

 

#12 2011-08-13 10:47:34

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

Re: Post Count?

LS97 wrote:

ProgrammingFreak wrote:

LS97 wrote:


Guess what me too...  tongue

I know.  tongue

Except I can't find it and also I don't want to use all the bandwidth because I'm download a 500MB linux distro  tongue

lol. I'm cleaning out all my files right now, so I'll probably find it soon.  tongue

Offline

 

#13 2011-08-13 10:48:45

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

Re: Post Count?

ProgrammingFreak wrote:

LS97 wrote:

ProgrammingFreak wrote:

I know.  tongue

Except I can't find it and also I don't want to use all the bandwidth because I'm download a 500MB linux distro  tongue

lol. I'm cleaning out all my files right now, so I'll probably find it soon.  tongue

4 seconds left for the download!
Done! (after 3 cancelled/failed downloads. One would think internet would work well enough to download only 500MBs...)

Last edited by LS97 (2011-08-13 10:49:35)

Offline

 

#14 2011-08-13 11:23:17

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

Re: Post Count?

Found it.  big_smile  You need an image called bg.png for this.

Code:

<?php

// find posts...
// line 1224


// start making image
//creates a image handle

$file_name= 'http://scratch.mit.edu/forums/viewtopic.php?id=46494';

$scratchpage = file_get_contents("http://scratch.mit.edu/forums/viewtopic.php?id=46494");

$start = stripos($scratchpage,'<dd><a href="search.php?action=show_user&user_id=118336">Posts</a>: ');
$end = stripos($scratchpage,'</dd>
',$start);

$posts = strip_tags(substr($scratchpage,$start + 67,$end - $start - 20));

// start
$img = imagecreatefrompng ( "bg.png" );
 
//choose a bg color, u can play with the rgb values
$background = imagecolorallocate( $img,232, 0, 135 );
 
//chooses the text color
$text_colour = imagecolorallocate( $img, 250, 218, 4);
$colour2 = imagecolorallocate( $img, 250, 218, 4);
 
//sets the thickness/bolness of the line
imagesetthickness ( $img, 3 );
 
//draws a line  params are (imgres,x1,y1,x2,y2,color)
imageline( $img, 20, 130, 165, 130, $text_colour );
 
//pulls the value passed in the URL
$text = 'Posts';
 
// place the font file in the same dir level as the php file
$font = 'font.ttf';
 
//this function sets the font size, places to the co-ords
imagettftext($img, 12, 0, 6, 15, $colour2, $font, $text);
//places another text with smaller size
imagettftext($img, 13, 0, 15, 35, $text_colour, $font, $posts);
 
//alerts the browser abt the type of content i.e. png image
header( 'Content-type: image/png' );
//now creates the image
imagepng( $img );
 
//destroys used resources
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $img );
?>

Offline

 

#15 2011-08-13 14:32:17

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

Re: Post Count?

ProgrammingFreak wrote:

Found it.  big_smile  You need an image called bg.png for this.

Code:

<?php

// find posts...
// line 1224


// start making image
//creates a image handle

$file_name= 'http://scratch.mit.edu/forums/viewtopic.php?id=46494';

$scratchpage = file_get_contents("http://scratch.mit.edu/forums/viewtopic.php?id=46494");

$start = stripos($scratchpage,'<dd><a href="search.php?action=show_user&user_id=118336">Posts</a>: ');
$end = stripos($scratchpage,'</dd>
',$start);

$posts = strip_tags(substr($scratchpage,$start + 67,$end - $start - 20));

// start
$img = imagecreatefrompng ( "bg.png" );
 
//choose a bg color, u can play with the rgb values
$background = imagecolorallocate( $img,232, 0, 135 );
 
//chooses the text color
$text_colour = imagecolorallocate( $img, 250, 218, 4);
$colour2 = imagecolorallocate( $img, 250, 218, 4);
 
//sets the thickness/bolness of the line
imagesetthickness ( $img, 3 );
 
//draws a line  params are (imgres,x1,y1,x2,y2,color)
imageline( $img, 20, 130, 165, 130, $text_colour );
 
//pulls the value passed in the URL
$text = 'Posts';
 
// place the font file in the same dir level as the php file
$font = 'font.ttf';
 
//this function sets the font size, places to the co-ords
imagettftext($img, 12, 0, 6, 15, $colour2, $font, $text);
//places another text with smaller size
imagettftext($img, 13, 0, 15, 35, $text_colour, $font, $posts);
 
//alerts the browser abt the type of content i.e. png image
header( 'Content-type: image/png' );
//now creates the image
imagepng( $img );
 
//destroys used resources
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $img );
?>

That's Daffy's code exactly how I saw it!
Mine's a bit enhanced... it changes color for special posts automatically and doesn't do some of the useless stuff on there  tongue

Offline

 

#16 2011-08-13 16:34:28

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

Re: Post Count?

LS97 wrote:

ProgrammingFreak wrote:

Found it.  big_smile  You need an image called bg.png for this.

Code:

<?php

// find posts...
// line 1224


// start making image
//creates a image handle

$file_name= 'http://scratch.mit.edu/forums/viewtopic.php?id=46494';

$scratchpage = file_get_contents("http://scratch.mit.edu/forums/viewtopic.php?id=46494");

$start = stripos($scratchpage,'<dd><a href="search.php?action=show_user&user_id=118336">Posts</a>: ');
$end = stripos($scratchpage,'</dd>
',$start);

$posts = strip_tags(substr($scratchpage,$start + 67,$end - $start - 20));

// start
$img = imagecreatefrompng ( "bg.png" );
 
//choose a bg color, u can play with the rgb values
$background = imagecolorallocate( $img,232, 0, 135 );
 
//chooses the text color
$text_colour = imagecolorallocate( $img, 250, 218, 4);
$colour2 = imagecolorallocate( $img, 250, 218, 4);
 
//sets the thickness/bolness of the line
imagesetthickness ( $img, 3 );
 
//draws a line  params are (imgres,x1,y1,x2,y2,color)
imageline( $img, 20, 130, 165, 130, $text_colour );
 
//pulls the value passed in the URL
$text = 'Posts';
 
// place the font file in the same dir level as the php file
$font = 'font.ttf';
 
//this function sets the font size, places to the co-ords
imagettftext($img, 12, 0, 6, 15, $colour2, $font, $text);
//places another text with smaller size
imagettftext($img, 13, 0, 15, 35, $text_colour, $font, $posts);
 
//alerts the browser abt the type of content i.e. png image
header( 'Content-type: image/png' );
//now creates the image
imagepng( $img );
 
//destroys used resources
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $img );
?>

That's Daffy's code exactly how I saw it!
Mine's a bit enhanced... it changes color for special posts automatically and doesn't do some of the useless stuff on there  tongue

Yeah, it could probably get some work...  tongue  I just don't get what the url is. Its something to do with your posts.

Offline

 

#17 2011-08-13 16:39:45

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

Re: Post Count?

Wait. The urls I have on that are my own threads. I must have added that.  tongue

Offline

 

Board footer