MyBB Community Forums

Full Version: Fix lightbulb problem for 1.2, 1.4 and 1.6
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
there is a problem with on/off forums lightbulb since MyBB 1.2.

I maked fix for this issue:
http://dev.mybb.com/issues/1230

But as you can see, my application was rejected...
I tested this on many boards and eveything is ok, so I decided to make fix public.

Instruction:
First, you must install my mod view unread posts - it adds "lastmark" to users table in DB - value is used as an additional confirmation when checking if there are unread posts

Second, you must replace original file inc/functions_forumlist.php to fifex version. Before this, make a backup!

I add all files attachments (for MyBB 1.6).
Let MyBB developers do with what they want - the problem is repaired and ready solution, easy to check Dodgy
They have not repaired the problem for two years, and when given ready-made solution is wrong ... I can not understand it Sad
What problem does this fix exactly?
I just read over the changes you made, it's very similar to the fix I made about 2 years ago.

http://community.mybb.com/thread-40284.html

By now that's horribly outdated of course. Your fix is not 100% correct, neither is mine - mainly because I stopped maintaining it, since the MyBB Devs don't want the fix, or didn't get the idea in the first place.

You have the right idea with the lastpost inheritance, so you're not crazy Toungue and I share your pain getting this rejected... been there, done that.

I think your implementation of that idea is slightly wrong, though. The lastmark is definitely not necessary, and the rest is a question of how you want the lightbulb to behave, in particular the question is whether an unread subforum should always mark the parent forum as unread too. Your answer to that question seems to be "Yes" (was my implementation at first, but it's very aggressive), personally I think "No" is the better answer (and was my implementation later on, using a proper lastpost, i.e. timestamp, inheritance instead of just unread yes/no - and if I had to implement this in MyBB right now this is the solution I'd go for), and "Maybe" is what I implemented in my Subforum Bulb plugin http://community.mybb.com/thread-40381.html in that it showed read status of parent and subforum in a combined icon.
As frostschutz mentioned, there are a few directions we could take with resolving this problem. An ultimate solution that solves everything could possibly be too resource-intensive, and we don't want to partly fix an issue.

Although fixes might seem to fix it on your forum, and many others, when you get to something like NCAABBS - which has an unholy amount of subforums - we have to be extremely careful. This is where rewriting the system to modern standards could be very beneficial.
@frostschutz:
Most of the existing boards scripts mark all forums up (using the "aggressive" method), because then users can see the information about new posts already on the board index. I think, is the best method so I used this.

IMO lastmark is necessary. The problem lies in the script, which marks forums read - it marks only one level up, if there is no others topics with unread posts.
User musts visit all levels of the board structure to to the original mechanism to function properly:
- category
-- all subcategories
--- forum
---- topic
In addition, in reverse order Big Grin


My fix works correctly even if the structure is as follows:
  1. Main category
    • category
      • category
        • forum
        • forum
      • forum


    • category
  2. Other main category...

I would like to draw attention to the fact, that there may be next to each other subforums and normal sections, which causes problems when we use lastpost value.


-----
@Tomm M:
Sorrry, but I can read this... you use eval, you don't cache "templates", you don't minimize the bbcode parsing operation...
Are a few extra IFs wrong solution in such a situation , even if they are executed in the loop and recursion? No.
Many plugins using hook system causes much greater load and certainly felt the boad slowdown...

For two years team only added MyBB unnecessary additives, instead of dealing with the problems of this type and load. The script is free, but that does not mean that we can not criticize the authors for this activity...


Sorry for my english - it isn't good enough to clarify some issues.
(2010-09-21, 07:53 AM)Tomm M Wrote: [ -> ]something like NCAABBS - which has an unholy amount of subforums

...is the exception, not the rule. There are maybe two or three forums like this, compared to hundreds of smaller (but still active) forums; MyBB optimizes for huge forums so much that smaller forums suffer because of it. A huge forum does not need lightbulbs whatsoever - they'll practically be always on anyway since there's always someone who writes something new. It's the small forums where broken lightbulbs become an annoyance. The "View New Posts" / "View Today's Posts" links in the header are another example for things that work only for huge forums; small forums will give you a very short list of threads only, which is why I replace it with "View Recent Posts" in every forum, using search.php?action=getdaily&days={$mybb->settings['threadreadcut']} and a larger value than default for threadreadcut. It's the only way to get a decent list/overview of possibly unread threads in a normal forum.

(2010-09-21, 08:59 AM)lukasamd Wrote: [ -> ]Most of the existing boards scripts mark all forums up (using the "aggressive" method), because then users can see the information about new posts already on the board index. I think, is the best method so I used this.

By aggressive I meant that as long as there is an unread subforum, the parent forum will also be marked as unread. Which seems to be your approach (as I've read it in your code, I've not actually tested it mind). I think it's a bad solution since it means that if a user does not want to read a particular subforum, he will never get rid of the parent forum bulb. The bulb becomes useless then since it doesn't say anything about new posts in the parent forum anymore. Of course the only way to really fix that is a combined icon which I implemented in my Subforum Bulb plugin, but without combined icon the soft approach is better.

The soft approach is also what MyBB currently does, and it should be kept that way; The only problem is that the current implementation does not work with forums that have subforums since it uses the wrong lastpost values for its calculations.

The whole problem sounds way more complicated than it actually is.

(2010-09-21, 08:59 AM)lukasamd Wrote: [ -> ]IMO lastmark is necessary.

You're duplicating information that's already there, and the only reason to do that ever is for caching purposes only, however this particular bit of information is already cached so, no, it is not necessary. No need to even look at the code. If you need it, you're masking another issue with it.

Anyway, this is my last reply to this thread, same as two years ago we're just going in circles with this thing and not actually getting nowhere. The MyBB devs don't want it fixed so that's that.

Best solution under the circumstances is to simply not use subforums since they're broken. Once you've accepted that fact that MyBB does not actually support subforums properly, it's surprisingly easy to do without.
As I mentioned in the issue, there are long-standing problems such as this that we'll be taking a look at prior to 2.0. We do want it fixed - nobody wants bugs in software - we just have to tread very carefully into these areas that have been like this for the best part of a decade.

lukasamd, some of the things you mentioned - such as the use of eval and the current plugin system - are practically rewriting the entire body of the software. This, in my opinion, is where us rewriting 2.0 comes in. Not for a simple feature release such as 1.6.
Just to chime in here. I don't think this is really a huge problem. Yes it's slightly inaccurate but an admin can decide to move the subforum to top category. I don't see how deciding to run less resource intense queries is a bad thing. It's part of what makes MyBB so attractive. They don't waste much. Taking the stance that resources aren't important is dangerous.

On all my forums big or small no one has ever complained to me about this issue. Hundreds of thousands of people seemingly don't care or haven't noticed. A few admins at MyBB are aware of this and that's about it. The on/off are handy but I believe overall people use View New Posts header link to see new posts and the flashy on/off icons simply are attractive. Most don't even know you can click them to mark as read.

So I'm going to comment that this isn't "broken" where it needs to be fixed. It's just not done the way some forums do it and because of that it's not considered accurate.

If it's going to be changed by MyBB I'm sure it won't be till 2.0 which will probably have a vast number of changes anyways with a whole new set of stuff to complain about. Smile