New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some code :P #1
some code :P #1
Conversation
Signed-off-by: emanuele <emanuele45@gmail.com>
Signed-off-by: emanuele <emanuele45@gmail.com>
Signed-off-by: emanuele <emanuele45@gmail.com>
Signed-off-by: emanuele <emanuele45@gmail.com>
Signed-off-by: emanuele <emanuele45@gmail.com>
Signed-off-by: emanuele <emanuele45@gmail.com>
I gotta re-write this to avoid the LEFT JOINS and avoid instantiate a new object on every request. I swear I did cover the news and all the feed options as the client actually saw that flaw, must have been lost on some obscure branch I never pushed. Thanks for the code. |
Yep, I've seen your note in the code (don't remember where), though I like joins and hate find_in_set (both because it's limited is quite a pita in any dbms other than MySQL, because it's just emulated with "sql" functions) so I played with it. 👼 |
OK, just tested this and is always saving a -1 which means every guest would be able to see a private topic. It also creates a row for each user selected which creates multiple rows for the same topic, it should only create 1 row per topic and all users should be appended to the existing users array. |
…at as reported by Suki were a "bit" broken :P, removed the instantiation of the class in the template Signed-off-by: emanuele <emanuele45@gmail.com>
Broken queries are broken... :P
No, not really. It's intended...well, it's the reason of the changes I did. Oh well, it has been funny, thanks! |
Wrong button... :P |
Still there are a few places where the queries are broken, like the profil, recent and I still don't get the -1, specially if ;SMF treats it as a guest, compatibility with old versions should be done on install, just a matter of porting the old data in the private_topics table to the new columns in topics table and I'm still pretty much prefer to have a single row per topic, as much as I would like to get rid of the find_in_set, there is no real alternative to it unless I take the huge task of normalize the table which of course is something I just ain't gonna do. There is also the cache problem, some queries are cached using some users data that not necessarily is the same for another user, in that sense it would be better to not mess with the queries at all and perform all the checks after the queries are done, that way you can perform the check against a cached private topics table. |
OK, I added the Boards and the auto suggest fixes, thanks, I wanted to fetch the news commit too but it fetches the entire PrivateTopics.xml with the find_in_set removed. Too many queries gets modified and it would be a nightmare to test all possible places. |
Not sure if you are interested in it (since this changes the behaviour a bit, even compared with the notes I found in the code), but I was reading the code and decided to try that approach (no idea about the implications and so on as usual ;)).
In any case, you may find useful the last commit:
emanuele45@b06ec39
that hides private topics from the feeds too.
The code is not tested much, so it may be broken, the PR is more of less to let you know the code exists if you want to consider it. ;)