fantastic! my codebase is much happier now
Latest posts made by Brass Man
Style topics differently by category
Is there any way to style topics differently based on the category they belong to? The current page name is appended to the <body> tag as a class, but I can't find a way for the CSS to know anything about a topic's parent category.
I can solve the issue with a javscript hack by reading the category name from the breadcrumbs, but this seems ... terrible.
Is there a less terrible way to expose category information to the topic template?
unable to edit groups/bad data
A while back I restored my database from a backup, and I have a feeling that backup may have been corrupt.
when I try to visit the admin/manage/groups page, my nodebb instance crashes and reboots. I get the error
Cannot read property 'indexOf' of undefined. After doing a little debugging I found that that the query for
groups:createtime(line 152 in src/database/mongo/sorted.ja), is returning some objects that DONT have "groups:createtime" as their key ... these documents don't have the expected schema, which is what's throwing that undefined error.
I've found, using the mongo console, when I use
find('_key': 'groups:createtime')I only get the objects I expect, but
find('_key': \groups:createtime\)returns the bad objects (note that the substring "groups:createtime" appears nowhere in _key string for those objects). More upsettingly, if I remove those bad objects by their ObjectId, they STILL return in that query ... despite the remove command returning without error, despite no longer being able to look the object up by it's ID.
I'm not clear on whether this is a NodeBB issue at all, or entirely on the Mongo side, but in the meantime, I can't edit anything in regards to groups (including adding/removing members to existing groups), and attempts at upgrading my forum version fail at the database migration step.
Store data about users at the plugin level
I'm working on setting up the reputation/flagging system for a new forum. I'd love to track the accuracy of each users post-flagging, so I can weight the flagging decisions they make accordingly, and identify candidates for moderation positions. This would be completely separate from any reputation gained by posting popular topics
To do this I'm assuming I need to store additional data on the post and user hashes - but I'm worried about forwards compatibility.
Is there a way to make those changes at the plugin level instead of mucking about with core? Is there a simpler approach to the problem I'm not seeing? Any best practices here?