[eluser]TheFuzzy0ne[/eluser]
Yes, that really does help. Thanks a lot for your comments. I know I over-think things a lot, but it's nice to know that it's not just me who sees problems like this in seemingly simple decisions.
The only reason I wanted to create the forum to be CI specific (to start anyway), is simply because CodeIgniter is a great framework, and doesn't have a forum tailored to take advantage of that framework. Also, as this is for a client, I need to get it finished ASAP, and I think the only way to do that, is to depend on CodeIgniter being the backbone. Also, there are a lot of forums out there, and I don't want to contend with them just yet, I just want to provide my fellow CodeIgniters with a fairly decent, simple forum. I think you're right though, forums are generally written in a procedural style. I was thinking of going with a model along these lines, all one model:
Code:
class Forums_model extends Model
{
function Forums_model() { parent::Model(); }
function get_forum($id) {} # Returns the specified forum as a forum object.
function add_forum($forum_object) {} # Adds a forum.
function update_forum($forum_object) {} # Updates a forum.
function delete_forum($id) {} # Deletes the specified forum.
function get_child_forums($forum_id) {} # Returns an array containing any child forums.
function get_child_threads($forum_id, $page_num) {} # Returns an array containing the child threads within the given page.
function add_thread($forum_id, $user_id, $title) {} # Adds a new thread
function delete_thread($thread_id) {} # Deletes a thread.
function update_thread($thread_id, $forum_id, $title) {} # Updates a thread.
function get_thread($thread_id, $page_num) {} # Returns an array of posts. Not sure if I actually need to implement this.
function add_post($post_object) {} # Adds a post.
function update_post($post_object) {} # Updates a post.
function get_post($post_id) {} # Returns the post with the specified ID.
}
I think it's a little bit inconsistent, as there's no thread object, and probably needs a little tweaking, but by using objects, I'm hoping to be able to easily implement changes (adding extra fields), without ending up with functions that take lots of arguments, in a seemingly random order. At least with objects and associative arrays, it allows for expansion much more easily IMHO. Also, there are a lot more methods to be added, but I just want to stick to the basics for now.
As always, comments and criticism welcome.
Thanks again!