Part of the EllisLab Network
   
1 of 2
1
CodeIgniter Forum System / Discussion Area
Posted: 18 September 2008 06:07 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

It is time that one was built so I started on one today.

I am not building the next vB or even punBB - but rather a simple discussion area that is easy to control for admins and simplistic for users.

I also want to build something that will help people new to CI when building a site. Like any beginner will tell you, reverse engineering a complex script like phpBB is really hard - so I hope that I can build something really simple to take apart.

I think that I will use ReduxAuth for the user management as it is so simple (1 file) yet complete (forgot password?, groups, etc).

I finished a simple 4 table structure for the database and was able to finish a model and basic controller for the system. (You can download my work below.) Right now you can browse forums, topics, and posts but you can’t do much else. wink


I am looking for a some people that would like to help put this together. I don’t think that it would be too hard for a couple guys to knock off in a day.

UPDATE:

I have created a google code page for people to suggest things
http://code.google.com/p/cxforum/

File Attachments
CXForum.zip  (File Size: 48KB - Downloads: 487)
 Signature 

My Blog, C2D, PHP Videos, Résumé, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 19 September 2008 10:20 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  3176
Joined  06-11-2007

PM’ed.

 Signature 

————————
Blog | Twitter | GitHub | BitBucket
————————-
PyroCMS - open source modular CMS built with CodeIgniter
PancakeApp - Simple, hosted invoicing/w project management

Profile
 
 
Posted: 19 September 2008 10:38 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  549
Joined  07-28-2008

That looks nice. Simple. Clean.

 Signature 

~ 4 All the Right Reasons ~

Profile
 
 
Posted: 19 September 2008 10:41 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  693
Joined  05-28-2008

Good stuff good stuff! I’d definately would like to help develop this! I’d even go as far as saying we don’t need a simple bulletin board, but a (reasonably) full featured engine. Something like the one we’re posting from now, but, as you say, easy to implement in CI sites, based on a well known auth system and relying on CI sessions so it’s easy to implement cross site logins (you can login with your forum id to post comments on other stuff too)

 Signature 

Bramme.net webdevelopment
If I had a nickel for every time someone told me that my idea for melting down coins to make a giant robotic parrot was a bad idea, I would have one kicka$$ giant robotic parrot.

Profile
 
 
Posted: 19 September 2008 02:29 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

Yes, I love to make stuff as open-ended as possible so that the developer can decide what they want to do with it. Vanilla strayed from the standard forum style (vb,phpbb,etc) as an example - but I would rather build the forum engine and then let the dev chose how to display forums, topics, and replies.

If you look at my code you will see the functions fetch_topics() can be given all kinds of values to change what is returned. For example, if you set fetch_topics(array(‘count’ => true)); it will ONLY return a number of the rows instead of the actual rows.

You shouldn’t need a bunch of functions for fetching different kinds of topics - one function should be smart enough to figure out all your needs.

 Signature 

My Blog, C2D, PHP Videos, Résumé, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 19 September 2008 02:53 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  693
Joined  05-28-2008

I’m totally with you! I was asked to do a large project (got handed to someone else in the end though) and they needed a forum too. I asked here and I got a reply that Vanilla was the handiest, but I really don’t like the way they display their categories, I much more like the traditional way all the major players (vBulletin, phpBB, this board) use.

Though it makes perfect sense to be able to do both! I guess you could hack Vanilla to display each category though… In the end, it’s just a bunch of queries.

 Signature 

Bramme.net webdevelopment
If I had a nickel for every time someone told me that my idea for melting down coins to make a giant robotic parrot was a bad idea, I would have one kicka$$ giant robotic parrot.

Profile
 
 
Posted: 19 September 2008 05:55 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  693
Joined  05-28-2008

Sorry for double post, but to bring this to the attention: I’ve added this to my (free) beanstalk account: http://brammm.svn.beanstalkapp.com/cxforum/trunk/

Seemed like a good idea to put this in SVN. I can only have 3 contributing members, but we’ll see what we do if we continue this, no?

 Signature 

Bramme.net webdevelopment
If I had a nickel for every time someone told me that my idea for melting down coins to make a giant robotic parrot was a bad idea, I would have one kicka$$ giant robotic parrot.

Profile
 
 
Posted: 19 September 2008 07:49 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Avatar
Rank
Total Posts:  43
Joined  09-13-2008

I’m so glad that some one is taking this up! When you have it ready, I’d be happy to beta your software. I have a very close group of friends. If there’s anything broken, we’ll find it for sure!

Profile
 
 
Posted: 20 September 2008 03:20 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

Ok, I need some MySQL Help for this.

I have four tables that store the 1) Forum Categories, 2) Forums, 3) Topics, 4) Posts/Replies.

When you browse a forum I list all the topics (limit 10) in that forum - but all good forums also show the USERNAME/ICON and the COUNT() of posts/replies to that topic.

Originally I was doing MASSIVE Left Joins in MYSQL that joined the USERS, COUNT(*) POSTS, and TOPICS tables so that I could get this data. However, after filling my DB with 3,000 users, 3,500 topics, and 13,000 posts/replies I decided that I would join the TOPICS/USERS tables so that I could show data on the TOPIC author - and then do a separate query to COUNT() the number of posts that match the topic id.

/* Fetch Topics and User data */
SELECT ci_forum_test_topics.*, ci_forum_test_users.emailci_forum_test_users.username 
FROM 
(`ci_forum_test_topics`) 
JOIN `ci_forum_test_usersON ci_forum_test_users.id ci_forum_test_topics.user_id 
WHERE 
`forum_id` = '1' AND `status` = 
ORDER BY 
`datedesc LIMIT 10

/* Count the Number of Replies */
SELECT COUNT(*) AS `numrowsFROM (`ci_forum_test_posts`) WHERE `topic_id` = '3473' AND `status` = 1 ORDER BY `datedesc 

Does anyone know of a better way to do this? Some forums keep a post_count column in each topic row so that they know how many replies there are to that topic. This saves them from needing to run a COUNT() query.

However, don’t think that I want to mess with updating that number for each post that is added/deleted.

 Signature 

My Blog, C2D, PHP Videos, Résumé, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 20 September 2008 03:24 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  747
Joined  01-13-2008
Bramme - 19 September 2008 09:55 PM

Sorry for double post, but to bring this to the attention: I’ve added this to my (free) beanstalk account: http://brammm.svn.beanstalkapp.com/cxforum/trunk/

Seemed like a good idea to put this in SVN. I can only have 3 contributing members, but we’ll see what we do if we continue this, no?

If required i can move it to my assembla svn, where the only limit is 500mb, which can be upgraded

 Signature 

Yonti - I am Currently looking for a business partner, to create the best developer hosting out there. If your interested PM me.

Fluxity Lighting - My other company.


I’m a Proud Supporter and Sponser of Tomorrows Web.

Profile
 
 
Posted: 20 September 2008 03:28 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008
Tom Glover - 20 September 2008 07:24 PM
Bramme - 19 September 2008 09:55 PM

Seemed like a good idea to put this in SVN. I can only have 3 contributing members, but we’ll see what we do if we continue this, no?

If required i can move it to my assembla svn, where the only limit is 500mb, which can be upgraded

Thanks for the hosting offers - but I only need help with building the system right now. It is hosted on http://code.google.com/p/cxforum/ anyway.

 Signature 

My Blog, C2D, PHP Videos, Résumé, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 20 September 2008 03:32 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  747
Joined  01-13-2008
Xeoncross - 20 September 2008 07:28 PM
Tom Glover - 20 September 2008 07:24 PM
Bramme - 19 September 2008 09:55 PM

Seemed like a good idea to put this in SVN. I can only have 3 contributing members, but we’ll see what we do if we continue this, no?

If required i can move it to my assembla svn, where the only limit is 500mb, which can be upgraded

Thanks for the hosting offers - but I only need help with building the system right now. It is hosted on http://code.google.com/p/cxforum/ anyway.

No problem, if your looking for a popper domain, and hosting, give me a call throught the forum, and i should be able to sort a discount out.

 Signature 

Yonti - I am Currently looking for a business partner, to create the best developer hosting out there. If your interested PM me.

Fluxity Lighting - My other company.


I’m a Proud Supporter and Sponser of Tomorrows Web.

Profile
 
 
Posted: 22 September 2008 05:24 PM   [ Ignore ]   [ # 12 ]  
Research Assistant
RankRankRank
Total Posts:  340
Joined  10-02-2006
Xeoncross - 20 September 2008 07:20 PM

However, don’t think that I want to mess with updating that number for each post that is added/deleted.

I have used both methods.

If I make a count query, it’s a sinlge-purpose function in the model matched to a view.

In many ways, I have found it just as easy to include a field with the count. I then add a +/- 1 via sql to the save/delete queries in the model.

Not much help, I know. This may just be a matter of personal preference.

Curious, why don’t you use Active Record?

 Signature 

Dotted line.

Profile
 
 
Posted: 22 September 2008 05:32 PM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008
Crimp - 22 September 2008 09:24 PM

Not much help, I know. This may just be a matter of personal preference.

Since every site should use some form of caching - I think that running an extra COUNT query will be fine. I have loaded my system with 13,000 posts, 3,000 Topics and 3,000 users and even with 30 queries for the most advanced page it only takes 0.2 seconds on my slow system.

Add to that to fact that I would then cache that page for 1-2 mins and I don’t have to worry about the load anymore. Saved me from adding UPDATE `post_count` WHERE `id` = 3… queries throughout my code.

Curious, why don’t you use Active Record?

Who said I didn’t smile

 Signature 

My Blog, C2D, PHP Videos, Résumé, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
Posted: 20 December 2008 03:24 AM   [ Ignore ]   [ # 14 ]  
Summer Student
Total Posts:  17
Joined  09-02-2007
Xeoncross - 20 September 2008 07:28 PM
Tom Glover - 20 September 2008 07:24 PM
Bramme - 19 September 2008 09:55 PM

Seemed like a good idea to put this in SVN. I can only have 3 contributing members, but we’ll see what we do if we continue this, no?

If required i can move it to my assembla svn, where the only limit is 500mb, which can be upgraded

Thanks for the hosting offers - but I only need help with building the system right now. It is hosted on http://code.google.com/p/cxforum/ anyway.

I’m implementing this for the forum on my site.  I’ll gladly work on developing some of this code.  I’d like to be basing my work off the latest, though (so I don’t duplicate work that’s already been done).  If you’re currently working on this project, can you let us know what you’ve done?

Profile
 
 
Posted: 20 December 2008 01:09 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  496
Joined  07-16-2008

I am not very close to releasing it (or even having my ideas worked out) but I can tell you it will use the DX Auth system that was just released. I’ll post an update when I have something.

 Signature 

My Blog, C2D, PHP Videos, Résumé, Super .htaccess, Extra hooks, and MicroMVC

Profile
 
 
   
1 of 2
1