Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 4th, 2006, 6:21 PM   #1
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
Post PHP Forum Code

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.
Attached Files
File Type: zip grimbb.zip (6.1 KB, 116 views)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Nov 5th, 2006, 7:55 PM   #2
jsilver608
Newbie
 
Join Date: Oct 2006
Posts: 20
Rep Power: 0 jsilver608 is on a distinguished road
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).
__________________
High Performance PHP
http://www.whenpenguinsattack.com
jsilver608 is offline   Reply With Quote
Old Nov 5th, 2006, 11:30 PM   #3
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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.
Attached Files
File Type: zip style_portal.zip (7.4 KB, 25 views)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Nov 6th, 2006, 4:11 AM   #4
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by jsilver608 View Post
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().
Arevos is offline   Reply With Quote
Old Nov 6th, 2006, 4:13 PM   #5
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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
Attached Files
File Type: zip grimbb.zip (10.7 KB, 24 views)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Nov 6th, 2006, 6:19 PM   #6
Indigno
Professional Programmer
 
Indigno's Avatar
 
Join Date: Dec 2005
Location: Anywhere non-productive
Posts: 267
Rep Power: 0 Indigno is an unknown quantity at this point
Send a message via AIM to Indigno Send a message via MSN to Indigno Send a message via Yahoo to Indigno
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.
__________________
Perhaps I should have a sticky topic for all of the times I "return" to this forum instead of a new one every time.
Indigno is offline   Reply With Quote
Old Nov 6th, 2006, 6:46 PM   #7
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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.
Attached Files
File Type: zip grimbb.zip (11.2 KB, 27 views)
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Nov 6th, 2006, 9:27 PM   #8
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
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?
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote
Old Nov 6th, 2006, 11:58 PM   #9
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Old Nov 7th, 2006, 2:57 AM   #10
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 439
Rep Power: 4 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis
grimpirate is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EXECryptor software protection Jean5 C++ 35 Oct 10th, 2006 8:10 PM
Little help whoawhoayoyo Assembly 8 Apr 18th, 2006 8:10 PM
How to post a question nnxion C++ 10 Jun 3rd, 2005 12:53 PM
How to post a question nnxion C++ 0 Jun 3rd, 2005 9:55 AM
How to post a question nnxion C 0 Jun 3rd, 2005 9:55 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:26 PM.

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