Merlin Sythove wrote: "Bug" is a matter of opinion. I think that if you have read permission, you will automatically have view permission. How else can you view your own posts? If another mod changes that assumption and detaches read and view so you can read topics but not view them (where's the logic in that?) then I would hardly call that a bug in my mod
Ok... lol.. I viewed it the other way. In the permissions, if you go to the advanced mode, you can set the various permissions seperately - ie: View, Read, Post, & Reply. With the case of the Yellow Card mod, a user need only have Read & Post permissions to report the post. Thus a Forum Admin can hide the reported posts area by setting the View permission to Private, Mod, or Admin. In doing this, it does show a hole or bug in your code (as I see it lol..), in that it will list and search for unread posts to which the user has no View permission to the area in which those posts might be stored.
I did it this way as I didn't want the other 150 members (or guests for that matter) being able to view the reports generated when someone reports a post. If say user "reported" sees that user "reportee" has reported them for whatever reason, their could be a backlash against the reportee. It's much better if these types of things have some annonimity - or at least that made sense to me.
So, I needed a way to fix your program, so that it wasn't listing areas to which a user had no view permissions. This was the easiest fix that I could come up with. Now, I say bug or hole.. you say.. not... it's like the old "Potatoe" or "Pah-tah-toe" (phonetically spelled so you get the meaning). Same thing... really.. just 2 differences in perception. I was hoping that by your response, that you might look into it, seeing as one has varying control of the permissions. If you have a solution that uses less system resources - I am very interested in seeing it. And I'm not harping on this because I'm some sort of ass or the like.
So while you can argue the point - I've just given you a good example as to where someone will not have view permission but needs read and post. All I was suggesting is that you might want to either add the code I have given you or come up with your own code that closes a possible problem. I'm sure there are other mods that make use of simple little permission or auth tricks, and this way you will not have anyone questioning why your mod is reporting posts/threads to which a user has no view permissions. I know my users immediately PM'd me saying what is this and why can't I read on it when I click on the link provided (it was returning - Post does not exist - error), which is why I had to come up with the fix in the first place.
Merlin Sythove wrote: Anyway, glad you have solved it. If other people have similar problems I may have a look into it to see if there is a more elegant way of solving the "interference" Fornow, your solution seems to work just fine.
I'm glad it's solved too. I try to decipher what the mods do and see if I can come up with a solution before contacting the authors and asking for their help. In this case.. the code may not be the tightest, but for now it solves the problem of my users questioning what is going on, and why they can't read something that lists as unread.
I leave the code and solution in your hands... add it as a contrib - include it in the code - make it more efficient - doesn't matter to me. I just thought I would pass it along and possibly help you with any future problems when someone says why is it listing unread threads that a user has no right to view. Thanks for your responses and a very efficient and usefull mod.