PHP Forum Code

Current work on coding a forum in PHP that doesn't use MySQL.

Page 1 of 1

12 Replies - 7822 Views - Last Post: 11 November 2006 - 08:28 PM Rate Topic: -----

#1 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

PHP Forum Code

Posted 05 November 2006 - 11:53 AM

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.

Files available here. I'll upload them to dreamincode when upload permissions have been reestablished.

Is This A Good Question/Topic? 0
  • +

Replies To: PHP Forum Code

#2 max302  Icon User is offline

  • Proud supporter of the lulz
  • member icon

Reputation: 2
  • View blog
  • Posts: 1,281
  • Joined: 05-March 06

Re: PHP Forum Code

Posted 05 November 2006 - 12:20 PM

No MySQL? Poor you, get a better host. If you dont mind a small banner add at the top, there is addyour.net that you might want to check out.
Was This Post Helpful? 0
  • +
  • -

#3 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1199
  • View blog
  • Posts: 7,307
  • Joined: 07-September 06

Re: PHP Forum Code

Posted 05 November 2006 - 08:25 PM

If you are lookign for a free host with MySQL then funpic.org is okay. It gives you one database with registration. THe only problem with it is that they place ads on your webpages.
Was This Post Helpful? 0
  • +
  • -

#4 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 05 November 2006 - 09:05 PM

Well t35.com has its benefits. It doesn't have a maximum limit on the amount of space my webpage files can take up, no limit on the types of files I can upload, a 500kB limit on the file size I can use, and no bandwidth restrictions. All of which are pretty cool perks in my opinion. Besides, MySQL is just one way of doing the same thing. Also, t35 is Skynet's deadliest coffee maker. ahahaha pirates rule!

UPDATE: new zip distro this time incorporates a logout feature as well, generates the folders that will contain the thread info, and the beginnings of the forum viewer.

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#5 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 06 November 2006 - 01:44 PM

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 File(s)


Was This Post Helpful? 0
  • +
  • -

#6 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 06 November 2006 - 04:18 PM

Update:
It's all functional now I'll shortly upload a link to where you can test it out on the web, but in the meantime if people would download and test/debug it, I would appreciate the help. So please make it malfunction lol.

To do:
Comment code properly and correct style sheets.

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#7 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

Re: PHP Forum Code

Posted 06 November 2006 - 05:45 PM

I'll test it when I get free time....which is getting scarce.
Was This Post Helpful? 0
  • +
  • -

#8 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 07 November 2006 - 12:27 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.
Was This Post Helpful? 0
  • +
  • -

#9 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 07 November 2006 - 03:30 PM

Update:
The forum now tests for illegal entry data of the following type:
chr(30), '<applet>'<applet', '<base', '<basefont', '<body', '<frame', '<frameset', '<head', '<html', '<iframe', '<link', '<meta', '<object', '<param', '<script', '<table', '<tbody', '<td', '<tfoot', '<th', '<thead', '<title', '<tr', '</applet', '</base', '</basefont', '</body', '</frame', '</frameset', '</head', '</html', '</iframe', '</link', '</meta', '</object', '</param', '</script', '</table', '</tbody', '</td', '</tfoot', '</th', '</thead', '</title', '</tr'
These are values which are assumed would allow modification/hacking of the visuals and/or content of the forum and might cause malicious redirects or popups and the like. If you guys have knowledge of any other way it could be attacked please post'em here so I can try to deal with them. By all means test them out on the forum itself, I'll just reupload it if it goes all haywire.
Was This Post Helpful? 0
  • +
  • -

#10 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 08 November 2006 - 01:05 PM

Update:
Forum was accepting empty topics and messages or composed purely of white-space characters (spaces, tabs, etc.) but now redirects to an error page in such a case.

To Do:
Finish commenting
Finish style sheets
Add administrative support
Was This Post Helpful? 0
  • +
  • -

#11 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1877
  • View blog
  • Posts: 20,284
  • Joined: 17-March 01

Re: PHP Forum Code

Posted 08 November 2006 - 01:08 PM

Grim, I've been enjoying reading about your project. Might I suggest you start your own Dream.In.Code Developer Blog?

Just click "Edit My Blog" in the member panel on the left side of this page.
Was This Post Helpful? 0
  • +
  • -

#12 grimpirate  Icon User is offline

  • Pirate King
  • member icon

Reputation: 149
  • View blog
  • Posts: 714
  • Joined: 03-August 06

Re: PHP Forum Code

Posted 08 November 2006 - 01:13 PM

Oh I had no idea I could do that lol, thx for the heads up skyhawk I will go ahead and do that.
Was This Post Helpful? 0
  • +
  • -

#13 Tuzoid  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 120
  • Joined: 20-August 06

Re: PHP Forum Code

Posted 11 November 2006 - 08:28 PM

Keep me informed :) It's been forever since I used flatfiles :P
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1