Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   PHP Forum Code (http://www.programmingforums.org/showthread.php?t=11802)

grimpirate Nov 4th, 2006 6:21 PM

PHP Forum Code
 
1 Attachment(s)
I noticed from the poll that some people are interested in forum software. I've actually programmed a forum in php for my personal webpage but it was kinda lame and I've noticed that a lot of people use phpBB for their own sites. I wanted to try and make something better than the first and less complicated than phpBB, not to mention that it should use file read/write operations rather than MySQL database access (the place where I host my site doesn't let you use MySQL as a free service but it does permit read/write operations). So here's my second attempt at a better forum. I call it GrimBB. Right now the only thing that's working is the login, registration and index pages. It uses style sheets and whatnot. This is just what I've come up with thus far. Feel free to test it out and perhaps suggest improvements. I plan to make it freely available and editable and whatever people wanna do with it. Needless to say I'll have to add comments to the code but for now it's mostly just code. I'll post up explanations on what's going on if anyone has questions or suggestions upon improvements.
The next pending task is to create the actual thread viewer for the given forums (if anyone has suggestions on that I'd appreciate them 'cause right now I'm drawing a blank).
P.S. All the data on the portal.php page which is listed in board_layout.inc is taken from one of the demos of the phpBB site. I didn't borrow any of their code however, I just needed some filler material in a tabular format.

jsilver608 Nov 5th, 2006 7:55 PM

wow, that's pretty cool.

Have you considered using sqllite for all of your operations? It would allow you to create your forum without requiring a database like mysql, but it still has the added benefit of a database (so you don't have to worry about file locks and such).

grimpirate Nov 5th, 2006 11:30 PM

1 Attachment(s)
Hmm... I know not of this sqllite, link me so that I may do some research. If it's something feasible then I'll make it work both ways. In the meantime here's an updated package. This one includes a logout AND the beginnings of the actual forum viewer. It also generates the folders that will store the thread info using the crc32 hash algorithm.

Arevos Nov 6th, 2006 4:11 AM

Quote:

Originally Posted by jsilver608 (Post 118436)
Have you considered using sqllite for all of your operations?

It depends if the version of PHP on grimpirate's server has been compiled with sqlite or not. You could probably check with phpinfo().

grimpirate Nov 6th, 2006 4:13 PM

1 Attachment(s)
Another update:
Registered users can now post new topics.
Topics that haven't been replied to within a given amount of time are automatically locked.
Topics and threads can be displayed.

To do:
Just gotta make the replies and it should all work just fine.
Comment code accurately.

Feel free to suggest code modifications/improvements/refinements

Indigno Nov 6th, 2006 6:19 PM

I like your enthusiasm, and that looks very good, but I think that the community PHP board will start from scratch. However, if you are going to join the Forum team, then I'm sure that your experience in making this one will be very helpful. If you have no intentions of joining, then keep up the good work. It looks great.

grimpirate Nov 6th, 2006 6:46 PM

1 Attachment(s)
Thx for the heads up Indigno, I didn't mean to imply that I was saying that the forum software suggested in the poll could use my own as a starting point. I just meant to say it sparked my own interest to do my own thing. I appreciate the feedback though.

Update:
Everything's working now, so I'd appreciate anyone testing it and trying to make it crash/malfunction. I'm going to post a link shortly to my own website with the forum's location for testing/debugging for those of you that it will be easier to just try it out on the web.

To do:
Gotta comment the code and work out the style sheets.

Jimbo Nov 6th, 2006 9:27 PM

Haven't had a chance to look through your code yet, but I'm just curious as to how you decided to store the data. Did you use SQLite as suggested above?

grimpirate Nov 6th, 2006 11:58 PM

Nah I didn't know what it was and was too lazy to look it up on Google or whatever. Unfortunately the code doesn't work on my server because it requires PHP5 for the hashing functions. Basically the code will generate folders for each of the forums and within these folders there will be text files. The text files will have one initial entry which is the topic of the thread and then all remaining entries will be of the following type: author, timestamp, post. Each entry is delimited by the ASCII character 0x1E.

grimpirate Nov 7th, 2006 2:57 AM

Well you can see the forum in action at http://grimpirate.4mak.net/portal.php. The source code for it isn't the same because I had to change the hash() and scandir() functions since they only function in PHP5. I had to implement crc32(), md5(), opendir(), readdir(), and closedir(). Curiously the crc32($somestring) function does not produce the same result as hash('crc32', $somestring). In order to post in the forum it's necessary to register. Basically, that just means make up a username and password. The forum doesn't accept any personal information.


All times are GMT -5. The time now is 1:35 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC