Developing CI Based Forum - WIP |
[eluser]srpurdy[/eluser]
Here is the code example for the main display. So that what I explained above actually makes some sense. Wouldn't mind some feedback on this code. This is part of the frontend forum controller. Code: /*
[eluser]Aken[/eluser]
[quote author="srpurdy" date="1344730892"]As for production. I guess you mean in terms of performance and security?[/quote] No, not particularly that. More so something that's more complete (IE a release candidate or beta) rather than a work in progress. Is this on / going to be on Github? That'd make me happy. :-p
[eluser]srpurdy[/eluser]
[quote author="Aken" date="1345249940"][quote author="srpurdy" date="1344730892"]As for production. I guess you mean in terms of performance and security?[/quote] No, not particularly that. More so something that's more complete (IE a release candidate or beta) rather than a work in progress. Is this on / going to be on Github? That'd make me happy. :-p[/quote] Yeah I may post it on Github. I want to clean things up before I do that though. I know I'll probably get kicked in the face with some code somewhere... and it's definitely not at a stage where I would consider it more complete yet. Although for what it does do it does it well so far.
[eluser]Aken[/eluser]
Github is certainly an excellent place for open source. I'd recommend it, or at least something like it (Bitbucket or what have you). Github is my favorite, though.
[eluser]srpurdy[/eluser]
[quote author="Aken" date="1345250655"]Github is certainly an excellent place for open source. I'd recommend it, or at least something like it (Bitbucket or what have you). Github is my favorite, though.[/quote] Yeah I'm more familiar with GitHub so I'd likely use that. I've revised my topic tracking logic below. I think this makes the most sense. Topic Tracking -> if topic has no row in the database for X User than topic is currently unread. -> If the topic does have a record in the database than compare the datetime stamp with the last post made in the topic to determine wither the topic is read or unread. -> If the topic has no row in the database and the user visits the topic. Than add a row for that user with the current date time. -> However if the user has more than 100 topics currently being tracked. Remove the oldest datetime topic from tracking. -> If the topic is older than 10 days old without any new posts than we will mark the topic as read. We will also not attempt to insert any row if the user visits that topic. (This will mean if someone does post. The 10 day window will now be erased so the topic should display as unread. -> Both the 10 Day window and the 100 max tracked topics per user will be configuration variables so these can be adjusted. -> Also an option for Mark All Topics as Read. This will put a timestamp into the users information, and any topic older than that datetime will be consider read at that point. If anyone see's some glaringly obvious flaws with that logic let me know.
[eluser]a.somervell[/eluser]
FYI: Forum built in CI http://www.biggie.co.nz/discussions
[eluser]srpurdy[/eluser]
For anyone that would like to see how things are right now. http://www.cidevforum.newedgedevelopment.com/en/forum/
[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 Only cool thing I got in there right now is the multi quote. . Currently doing structural planning on moderation tools. So at least when that's in there it'll be a more solid base. 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. (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.. This is the one below bit of a monster Code: function get_posts_by_forum($limit,$offset) Shawn
|
Welcome Guest, Not a member yet? Register Sign In |