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

#1 2011-04-16 15:15:36

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Panther 'Mini-Forum' Project

So what I've done is taken Panther's ( get content from url ) block and I've coded some PHP to make a forum in Panther. Currently the length of a post being made in Panther is very small. Just a few words work.

The original topic: http://panther-forum.4815094.n2.nabble. … 69996.html

So basically the project is here: http://scratchnetwork.zxq.net/SNForum1.2.pt.zip

Press the green flag, it should ask you to login or create a user:

Code:

Login or Create User? ( LI or CU ): LI
Username: guest
Password: guest

For 'simplicity' I set up the forum so it shows the topic/post ID next to everything. The ID is very important for this forum:

Code:

VT = View Topic
PT = Post in Topic
LT = List Topics
What would you like to do?: LT
0 Announcements - Posts: 2
2 Chat - Posts: 8
3 Support - Posts: 0
4 Suggestions - Posts: 0
What would you like to do?: VT
View Topic ID?: 0
Topic Name: Announcements 0
0 Magnie says: Set up the 'forum'!
15 Magnie says: Got the LT ( List Topics ) command to show how many posts are in each topic.

The way I've set it up, it isn't the most user-friendly, but hopefully I'll be able to do that later. ( I've got a customized one that is much more user-friendly  tongue  )

If you have any questions, I'm willing to answer the best I can.  smile

Last edited by Magnie (2011-04-23 14:56:38)

Offline

 

#2 2011-04-16 18:59:27

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

Re: Panther 'Mini-Forum' Project

I love this idea and can't wait to see developments  wink


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

Offline

 

#3 2011-04-16 19:01:03

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

Re: Panther 'Mini-Forum' Project

What does the .pt file open with?


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

 

#4 2011-04-16 19:04:07

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Panther 'Mini-Forum' Project

.pt opens in Panther.  smile  http://pantherprogramming.weebly.com/

Last edited by Magnie (2011-04-16 19:04:29)

Offline

 

#5 2011-04-16 19:09:32

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

Re: Panther 'Mini-Forum' Project

Magnie wrote:

.pt opens in Panther.  smile  http://pantherprogramming.weebly.com/

OH! LOL! I never noticed that! Thanks.


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

 

#6 2011-04-17 09:35:41

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Panther 'Mini-Forum' Project

This is a really cool idea. Except, whenever I try to post it says "Failed to post"  hmm


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#7 2011-04-17 11:58:02

ugog10
Scratcher
Registered: 2011-03-05
Posts: 8

Re: Panther 'Mini-Forum' Project

Where do you download panther from?????????

Offline

 

#8 2011-04-17 14:21:40

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

Re: Panther 'Mini-Forum' Project

ugog10 wrote:

Where do you download panther from?????????

From the Panther website  wink  http://www.pantherprogramming.weebly.com


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

Offline

 

#9 2011-04-18 11:31:09

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Panther 'Mini-Forum' Project

ScratchReallyROCKS wrote:

This is a really cool idea. Except, whenever I try to post it says "Failed to post"  hmm

I would assume the reason is because the username/password are incorrect. The code restrictions for posting are:

Code:

($r0['user'] == $user && $r0['pass'] == $pass)

So unless you are trying to create a topic ( CT = Create Topic ) only people with the 'Owner' rank can create topics. ( I don't want the place to be spammed with topics when you type LT )

Offline

 

#10 2011-04-19 18:09:31

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Panther 'Mini-Forum' Project

Magnie wrote:

ScratchReallyROCKS wrote:

This is a really cool idea. Except, whenever I try to post it says "Failed to post"  hmm

I would assume the reason is because the username/password are incorrect. The code restrictions for posting are:

Code:

($r0['user'] == $user && $r0['pass'] == $pass)

So unless you are trying to create a topic ( CT = Create Topic ) only people with the 'Owner' rank can create topics. ( I don't want the place to be spammed with topics when you type LT )

Yeah, I forgot my password for ScratchReallyROCKS on it, so I jet made a new account called SRR  smile


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#11 2011-04-19 18:25:27

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Panther 'Mini-Forum' Project

ScratchReallyROCKS wrote:

Magnie wrote:

ScratchReallyROCKS wrote:

This is a really cool idea. Except, whenever I try to post it says "Failed to post"  hmm

I would assume the reason is because the username/password are incorrect. The code restrictions for posting are:

Code:

($r0['user'] == $user && $r0['pass'] == $pass)

So unless you are trying to create a topic ( CT = Create Topic ) only people with the 'Owner' rank can create topics. ( I don't want the place to be spammed with topics when you type LT )

Yeah, I forgot my password for ScratchReallyROCKS on it, so I jet made a new account called SRR  smile

I believe you meant *just


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#12 2011-04-19 19:45:47

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Panther 'Mini-Forum' Project

ssss wrote:

ScratchReallyROCKS wrote:

Magnie wrote:


I would assume the reason is because the username/password are incorrect. The code restrictions for posting are:

Code:

($r0['user'] == $user && $r0['pass'] == $pass)

So unless you are trying to create a topic ( CT = Create Topic ) only people with the 'Owner' rank can create topics. ( I don't want the place to be spammed with topics when you type LT )

Yeah, I forgot my password for ScratchReallyROCKS on it, so I jet made a new account called SRR  smile

I believe you meant *just

Stupid iPod spellcheck.  tongue


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#13 2011-04-19 19:47:10

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Panther 'Mini-Forum' Project

ScratchReallyROCKS wrote:

ssss wrote:

ScratchReallyROCKS wrote:


Yeah, I forgot my password for ScratchReallyROCKS on it, so I jet made a new account called SRR  smile

I believe you meant *just

Stupid iPod spellcheck.  tongue

Fail much?


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#14 2011-04-19 19:54:06

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Panther 'Mini-Forum' Project

This is soooooooooo cool! But you should change it so you can use a single statement (like "VT 4") instead of typing "vt" then hitting enter and typing "4". Also, I can't make a new topic. Or better yet, just make it "v", "c", "p", and "l"...the "t" is redundant.

Also, you really should be SHA-1 or md5-encrypting your passwords. Just saying.  smile


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#15 2011-04-19 19:58:30

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

Re: Panther 'Mini-Forum' Project

fullmoon wrote:

This is soooooooooo cool! But you should change it so you can use a single statement (like "VT 4") instead of typing "vt" then hitting enter and typing "4". Also, I can't make a new topic. Or better yet, just make it "v", "c", "p", and "l"...the "t" is redundant.

Also, you really should be SHA-1 or md5-encrypting your passwords. Just saying.  smile

they're already MD5'd, I believe  smile  It is pretty cool!


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

Offline

 

#16 2011-04-19 20:03:56

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Panther 'Mini-Forum' Project

sparks wrote:

fullmoon wrote:

This is soooooooooo cool! But you should change it so you can use a single statement (like "VT 4") instead of typing "vt" then hitting enter and typing "4". Also, I can't make a new topic. Or better yet, just make it "v", "c", "p", and "l"...the "t" is redundant.

Also, you really should be SHA-1 or md5-encrypting your passwords. Just saying.  smile

they're already MD5'd, I believe  smile  It is pretty cool!

My bad. I was just looking at this line:

Code:

($r0['user'] == $user && $r0['pass'] == $pass)

Someone needs to show the Scratch team this as an example of why we need a Scratch 2.0 with HTTP GET and POST.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#17 2011-04-20 13:19:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Panther 'Mini-Forum' Project

fullmoon wrote:

This is soooooooooo cool! But you should change it so you can use a single statement (like "VT 4") instead of typing "vt" then hitting enter and typing "4". Also, I can't make a new topic. Or better yet, just make it "v", "c", "p", and "l"...the "t" is redundant.

Also, you really should be SHA-1 or md5-encrypting your passwords. Just saying.  smile

Yes, I was thinking of that as well, though I've forgotten how to do that in an "un-messy" way ( check every letter until it hits a space, cleaning out extra stuff, etc.  tongue  ) though I'll try to add that in the "Next version of the viewer"  smile

Yes, the passwords are MD5  smile  I add extra text to the beginning and end for extra security against those "MD5 Decrypters"  smile  Though I am thinking of using SHA-1 for more security. The full code for posting a message is:

Code:

<?php
$con = mysql_connect('localhost','username','password');
mysql_select_db("database", $con);
$tid = $_GET['tid'];
$text = $_GET['txt'];
$user = $_GET['u'];
$pass = $_GET['p'];
$pass = md5('some text here'.$pass);

$r0 = mysql_query("SELECT * FROM sn_users
WHERE user='$user'");

$r0 = mysql_fetch_array($r0);

if ($r0['user'] == $user && $r0['pass'] == $pass) {

$r1 = mysql_query("SELECT *
FROM `sn_posts`
WHERE pid = (
SELECT MAX( pid )
FROM `sn_posts` )");
$t1 = mysql_fetch_array($r1);
$pid = $t1['pid'] + 1;

$add_post = mysql_query("INSERT INTO sn_posts (`author`,`text`,`tid`,`pid`)
VALUES ('$user', '$text', '$tid', '$pid')");
echo 'Succesfully posted, now please revisit the topic to see the post.';
}
else { echo 'Failed to post.'; }
?>

Yes, I know my coding is messy  tongue

Once Scratch gets HTTP POST and GET then I won't have to use Panther for this project. No offense towards Panther and it's team.  smile

Apparently I should use MySQLi instead of MySQL, so for the 'next version' I'll fix up my coding for MySQLi. I'm also open to any suggestions.  smile

Offline

 

#18 2011-04-23 14:55:59

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Panther 'Mini-Forum' Project

Well, a new, small update, I've implemented Fullmoon's request for putting commands on a single line "VT 2" etc.  smile  And the interface is a little better, not messy basically.  smile

http://scratchnetwork.zxq.net/SNForum1.2.pt.zip

Though I admit, this post was more of a bump than an update. But still, go try out the project.  smile

Last edited by Magnie (2011-04-23 14:58:36)

Offline

 

#19 2011-04-23 15:52:39

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Panther 'Mini-Forum' Project

If you made the id fields in the database "auto_increment", you wouldn't have to manually increment the id all the time.  wink


/* No comment */

Offline

 

#20 2011-04-23 18:49:05

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Panther 'Mini-Forum' Project

I guess that is true, oh well.  tongue

Offline

 

Board footer