Welcome Guest, Not a member yet? Register   Sign In
Developing CI Based Forum - WIP
#19

[eluser]srpurdy[/eluser]
It's not in a state that's worth buying right now lol. (I also haven't decided wither it will be free or not) But it will be open source that's for sure. So if it isn't free than it'll just depend on the honor of the people using it.

But much of the admin area right now is not fully functional, there is no moderation, can't move or lock topics. So a lot missing still lol Smile

Only cool thing I got in there right now is the multi quote. Tongue. Currently doing structural planning on moderation tools. So at least when that's in there it'll be a more solid base. Smile

Also I have 1 query that's starting to bug me a bit, not sure if it's going to be good on a large forum. Seems a bit slow. So I'm not happy with that. Tongue (0.2 to 0.4 seconds for 1 query is too much!) It's only 0.002 after mysql query cache kicks in, and it's only 0.2 or so when the full list is displayed (20 topics default)

I only wrote it this way to avoid query stacking so I can display everything in a single query. Just not sure how well it will do if the database has 20,000 records or more in it. I keep thinking I must be missing an index somewhere but looked 17 times lol.. Smile

This is the one below bit of a monster Smile

Code:
function get_posts_by_forum($limit,$offset)
  {
  $uri = $this->uri->segment(4);
  $posts_by_forum = $this->db
   ->where('forums.forum_url_name', $this->uri->segment(3))
   ->where('forum_topics.forum_id = forums.forum_id')
   ->where('forum_permissions.forum_id = forums.forum_id')
   //->where('forum_posts.is_topic', 'Y')
   ->select('
    forum_permissions.allow_html,
    forum_permissions.allow_bbcode,
    forum_permissions.allow_topic,
    forum_permissions.allow_reply,
    forum_permissions.allow_edit,
    forum_permissions.allow_delete,
    forum_permissions.allow_attachments,
    forum_permissions.allow_sticky,
    forum_topics.post_title,
    forum_topics.topic_id,
    forum_topics.post_text,
    forum_topics.sticky,
    forum_topics.topic_views,
    forums.public,
    forums.forum_id,
    (select users.first_name from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date ASC LIMIT 1) as first_name,
    (select users.last_name from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date ASC LIMIT 1) as last_name,
    (select profile_fields.display_name from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date ASC LIMIT 1) as display_name,
    (select profile_fields.nickname from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date ASC LIMIT 1) as nickname,
    (select count(forum_posts.topic_id) from forum_posts where forum_posts.topic_id = forum_topics.topic_id) as total_posts_count,
    (select count(forum_is_post.topic_id) from forum_is_post where forum_is_post.topic_id = forum_topics.topic_id) as total_posts,
    (select forum_posts.post_id from forum_posts where forum_posts.topic_id = forum_topics.topic_id ORDER BY forum_posts.post_date DESC LIMIT 1) as post_date_order,
    (select users.first_name from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_first_name,
    (select users.last_name from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_last_name,
    (select profile_fields.display_name from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_display_name,
    (select profile_fields.nickname from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_nickname,
    (select forum_posts.topic_id from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_topic_id,
    (select users.id from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_user_id,
    (select forum_posts.post_date from forum_posts,users,profile_fields where forum_topics.topic_id = forum_posts.topic_id AND forum_posts.approved = "Y" AND forum_posts.user_id = users.id AND users.id = profile_fields.user_id ORDER BY forum_posts.post_date DESC LIMIT 1) as last_post_date,
   ')
   ->from('forums,forum_topics,forum_permissions')
   ->order_by('forum_topics.sticky', 'desc')
   ->order_by('post_date_order', 'desc')
   ->limit($limit,$offset)
   //->join('forum_posts', 'forum_posts.topic_id = forum_topics.topic_id')
   //->order_by('post_date_order', 'desc')
   ->get();
  return $posts_by_forum;
  }

Shawn


Messages In This Thread
Developing CI Based Forum - WIP - by El Forum - 08-10-2012, 12:22 AM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 03:26 AM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 06:23 AM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 09:28 AM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 12:48 PM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 03:04 PM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 04:55 PM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 05:01 PM
Developing CI Based Forum - WIP - by El Forum - 08-11-2012, 05:21 PM
Developing CI Based Forum - WIP - by El Forum - 08-17-2012, 01:25 PM
Developing CI Based Forum - WIP - by El Forum - 08-17-2012, 05:23 PM
Developing CI Based Forum - WIP - by El Forum - 08-17-2012, 05:32 PM
Developing CI Based Forum - WIP - by El Forum - 08-17-2012, 05:41 PM
Developing CI Based Forum - WIP - by El Forum - 08-17-2012, 05:44 PM
Developing CI Based Forum - WIP - by El Forum - 08-18-2012, 07:39 AM
Developing CI Based Forum - WIP - by El Forum - 08-19-2012, 01:26 PM
Developing CI Based Forum - WIP - by El Forum - 12-29-2012, 06:03 AM
Developing CI Based Forum - WIP - by El Forum - 12-29-2012, 04:39 PM
Developing CI Based Forum - WIP - by El Forum - 12-30-2012, 07:11 AM
Developing CI Based Forum - WIP - by El Forum - 01-03-2013, 10:36 PM
Developing CI Based Forum - WIP - by El Forum - 01-04-2013, 05:05 AM
Developing CI Based Forum - WIP - by El Forum - 01-04-2013, 12:25 PM
Developing CI Based Forum - WIP - by El Forum - 01-07-2013, 01:20 AM
Developing CI Based Forum - WIP - by El Forum - 01-07-2013, 07:00 PM
Developing CI Based Forum - WIP - by El Forum - 01-14-2013, 06:03 AM
Developing CI Based Forum - WIP - by El Forum - 01-25-2013, 06:57 AM
Developing CI Based Forum - WIP - by El Forum - 01-28-2013, 04:29 PM
Developing CI Based Forum - WIP - by El Forum - 01-28-2013, 06:33 PM
Developing CI Based Forum - WIP - by El Forum - 01-29-2013, 06:22 PM
Developing CI Based Forum - WIP - by El Forum - 01-30-2013, 04:38 PM
Developing CI Based Forum - WIP - by El Forum - 02-04-2013, 06:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB