SneakyDave Posted June 26, 2016 Posted June 26, 2016 (edited) I have a pubic ignore list almost feature complete here: Ignore List | BASH.zone There isn't much data on the site to really be "useful", but it displays the top members that have been ignored the most, and lists all members' people they ignore, as well as who is ignoring them (yet to finish). I'm currently ignoring Gary and GTB just to demonstrate the functionality. Curiously, the unregistered user "Kramer" is the one ignoring Sheldon and I. I'm not sure how they are able to ignore administrators, but maybe that's an permission I set on administrator accounts. If you see anything that might make it more useful, please let me know. I'm not sure where a link to this page should exist? May on the "People you ignore" page? It doesn't seem to justify being a tab. bugs / outstanding items. I have to clean up the styling a little bit. When "Nobody" is displayed, it uses the tooltip from the ignoring member. The title "Ignoring" title is displayed, when the user's status tooltip should suffice. Finish displaying the [TO DO] list of "ignored by" members. The sort should include the username, as well as the number of people ignoring the member. Rework the model to try to reduce queries. Edited June 27, 2016 by SneakyDave 1 Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Paul Posted June 26, 2016 Posted June 26, 2016 This has to be released on XenForo. I bet it would be downloaded a lot. 1 Quote
SneakyDave Posted June 26, 2016 Author Posted June 26, 2016 I might do that after I get a few more bugs worked out. At the moment, it uses a page node with a php callback. Pages can't be packaged as addon's, so I'd have to convert that to a public controller. Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Scrotnig Posted June 26, 2016 Posted June 26, 2016 Ignore lists are for cowards. :) Better to not have anyone on your ignore list, but just actually ignore people. Quote "GRIMM is a GAY LORD. And I don't talk to GAYS!" - Gary Thomas Bolton, 2002
Daniel Hood Posted June 27, 2016 Posted June 27, 2016 I might do that after I get a few more bugs worked out. At the moment, it uses a page node with a php callback. Pages can't be packaged as addon's, so I'd have to convert that to a public controller. On the other hand you could just create the page with the install callback in the add-on. No need for a controller and route, just the two files (I presume that's what it is), the actual page callback file and then the install script. Quote
SneakyDave Posted June 27, 2016 Author Posted June 27, 2016 ooohhhhh.. thanks for that Daniel, didn't think of that. I have the page updated now with most of the bugs worked out. I think I'm doing too many queries though, so I'm going to try to reduce them. I haven't done an addon accessing models yet, and getting db results to work correctly in templates gives me a headache. I wish there was a better way to debug that stuff. Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Daniel Hood Posted June 27, 2016 Posted June 27, 2016 No problem. I don't have the db schema handy anymore but I imagine you could fetch the users being ignored by querying against the xf_user_ignore table grouping by userid and counting the number of rows. Loop through those results to compile an array of user ids (the ones being ignored). Then use XenForo_Model_User::getUsers() or getUsersById() or something, been a minute, and send the array to get the data for the users necessary. [Edit] Then loop through the users and join in the number of people being ignored? 1 Quote
SneakyDave Posted June 27, 2016 Author Posted June 27, 2016 I use this to get the top users being ignored. I don't think there's anything wrong with this, other than possibly not needing the user_option table. public function getIgnoredUserList() { $sql = ' SELECT user.*, user_profile.*, user_option.*, count(*) as total FROM xf_user_ignored as user_ignored INNER JOIN xf_user AS user ON (user.user_id = user_ignored.ignored_user_id AND user.is_banned = 0) INNER JOIN xf_user_profile AS user_profile ON (user_profile.user_id = user.user_id) INNER JOIN xf_user_option AS user_option ON (user_option.user_id = user.user_id) GROUP BY ignored_user_id ORDER BY total DESC, user.username LIMIT 10 '; return $this->fetchAllKeyed($sql, 'user_id'); } I use this to get the "Ignored by x members", given a userid. I thought this query could use a little work, but maybe it's about as good as I can get it. It only runs once per user from the list above. public function getIgnoredByUserList($userId) { $sql = ' SELECT user.*, user_profile.*, user_option.* FROM xf_user_ignored as user_ignored INNER JOIN xf_user AS user ON (user.user_id = user_ignored.user_id AND user.is_banned = 0) INNER JOIN xf_user_profile AS user_profile ON (user_profile.user_id = user.user_id) INNER JOIN xf_user_option AS user_option ON (user_option.user_id = user.user_id) WHERE user_ignored.ignored_user_id = ? '; return $this->fetchAllKeyed($sql, 'user_id', $userId); } Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Daniel Hood Posted June 27, 2016 Posted June 27, 2016 Ah ok, yeah you're already doing what I suggested within the first query. The second query is what should be modified. I'd recommend avoiding any query that can be executed an arbitrary amount of times, when doable. It's not that it's a bad query in terms of execution since everything is indexed appropriately but once that page has 20-50-so-on users on the page it's not ideal. I'd recommend changing it to where you get all the users ignoring all the users on the page. Send it an array and then do "Where user_ignored.ignored_user_id IN (" . $this->_getDb()->quote($userIds) Then you have one query regardless of how many users are being analyzed. [Edit] It's a similar concept to how XenForo does "getAndMergeAttachments" or whatever. Quote
SneakyDave Posted June 27, 2016 Author Posted June 27, 2016 Yeah, I'll work on that as a next step. The only other small problem that would exist if I didn't convert this into a route and controller is that the page would be accessible by /pages/ignore-list. I created a route filter to make it just /ignore-list, so it doesn't "look" like a XenForo page. That's not a big deal though. Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Daniel Hood Posted June 27, 2016 Posted June 27, 2016 You can also create route filters within the installer, XenForo Media Gallery actually does it (or used to, before it was an official add-on). Quote
SneakyDave Posted June 27, 2016 Author Posted June 27, 2016 I figured I could do that, I was just looking at here with XFMG. Now I'm not sure if I should just put that all in an installer, or just go and create the route/controller. decisions, decisions. Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
SneakyDave Posted June 27, 2016 Author Posted June 27, 2016 (edited) Well, I got the "getIgnoredByUserList" query working to grab all results for the page, rather than running for each user from the first query, but the fetchAllKeyed by 'user_id' method results in removing the duplicate user_id's from the array, which may exist, if a person is ignored by multiple people. So I need to use a different method, maybe just a get->Db() call, or fetchAllKeyed by 'nothing' to get all the duplicitous results, and then work with that. Thanks for the extended help. Edited June 27, 2016 by SneakyDave Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Sandyman Posted June 27, 2016 Posted June 27, 2016 @SneakyDave remove your nose from @Daniel Hood's ass please. You trash talked the fuck out of him for what he did, and now you kiss his ass? Quote Donald Trump is living RENT FREE in Tracy Perry/One-Up's head
SneakyDave Posted June 27, 2016 Author Posted June 27, 2016 This thread is about coding, it isn't about crowdfunding. Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Micah Posted June 28, 2016 Posted June 28, 2016 Out of curiosity, not that I particularly much as I don't ignore people, but what exactly is the purpose of this? :P I assume for shame and what not lol. I am just curious if there is anything else I am missing from it lol. Quote
SneakyDave Posted June 28, 2016 Author Posted June 28, 2016 The idea came from this thread: Remove the ignore function? | BASH.zone I was commenting on how the ignore function action is seldom used on forums, and usually only brought up in discussion to spite other members, so I had planned to remove it here. Chickenscratches (バイス) commented in chat that he liked the idea because he would then know for sure that everybody would be privy to his trolling, and would sleep better knowing his intended posts were being accepted by their intended recipients, or some shit like that. Knowing his intentions, and other members saying that they actually use the ignore feature on Chickenscratches (referred to as 'bitch ass mother fuckers'), I changed my mind about removing the ability to ignore members. The Ignore List was an idea by Paul o try to satiate the seething chickenscratches, lol. But it was too little, too late. Chickenscratches left like dust in the wind, due to my apparent hypocrisy. Quote "I wonder if wife Susie knows about the vile crap he posts on his site and how it fits in with her "youth ministry"?" - Dr. Howard Rosenzweig, former owner of TheAdminZone
Sandyman Posted June 28, 2016 Posted June 28, 2016 This is bullshit, the only reason Vice/Tool/Troll is gone is he couldn't deal with Tracy Perry. He wasn't able to get under Tracy's skin, and actually Tracy got under his, so he ran like a bitch ass little kid and came up with excuses. Typical keyboard warrior, all big and bad and tough until someone gives it back to him online or in real life, and then they whine and cry like the little bitches they are. TLDY; Tracy Perry owned Vice/Troll/Tool, and he ran away from here. Quote Donald Trump is living RENT FREE in Tracy Perry/One-Up's head
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.