HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Search
-
Re: Anyone know of an addon to ban users from a discussion?
Not sure why this isn't working: $DiscussionID = $sender->RequestArgs[0]; $DiscussionModel = new DiscussionModel(); $DiscussionModel->getID($DiscussionID); $discussionAttributes = $DiscussionModel->Attributes; print_r($discussionAttributes); If I do print_r($DiscussionModel) I can see all the data for that row in the… -
Re: Anyone know of an addon to ban users from a discussion?
Ok moving on to saving (again)... Ok I thinkthis is what we are looking for in the serialized comlumn save. I understand that $sender->RequestArgs[0] is the discussionid and i have taken the usernames and gotten an array of userids and then imploded and appended the brackets. I am assuming that we had to create the string… -
Re: Anyone know of an addon to ban users from a discussion?
instead I was able to get the value of the attributes field by using a query: $DiscussionID = $sender->RequestArgs[0]; $Attributes = Gdn::sql() ->select('Attributes') ->from('Discussion') ->where('DiscussionID',$DiscussionID) ->get(); // Now it's a dataset! //print_r($Attributes); foreach ($Attributes->resultArray() as… -
Re: Anyone know of an addon to ban users from a discussion?
Oh no, the result of a:1:{s:13:"DiscussionBan";N;} is array ( 'DiscussionBan' => NULL,); So everything is correct except for the fact that $userIDs is null when you save it. There is a typo: $userIDs = []; foreach ($userArray as $name) { $userModel = new UserModel(); $user = $userModel->getByUsername($name); $userIDs[] =… -
Re: Anyone know of an addon to ban users from a discussion?
It depends. You can do it like that, but in the end you would need the saveToSerializedColumn method in this case If just have created a test table and like to save test data, feel free to do it any way you want. Using a model is the safest way for standard tables, though. $discussionModel = new DiscussionModel(); // Since… -
Re: Anyone know of an addon to ban users from a discussion?
Here is my class...Where I do not know how to get at the attributes data. While I have done a lot of PHP scripting I am new to object oriented PHP coding. <?php// Define the plugin:$PluginInfo['discussionBan'] = array( 'Name' => 'Discussion Ban', 'Description' => 'Grants moderators or permissioned users ability to ban… -
Re: Anyone know of an addon to ban users from a discussion?
Yeah I looked at the Git page you linked and you are right it looks correct against that, but it breaks the code for some reason. I have this working correctly but it is a kludgey way of doing it. if(isset($_POST['UserNames'])){ $UserNames = $_POST['UserNames']; //echo $UserNames; // make array from list of usernames… -
Re: Anyone know of an addon to ban users from a discussion?
I have taken a stab at populating the form for a discussion that already had banned users.... Here is what I came up with. I didn't know how to get around looping through the array to get the usernames from the usermodel query. <?php// Define the plugin:$PluginInfo['discussionBan'] = array( 'Name' => 'Discussion Ban',… -
Re: Anyone know of an addon to ban users from a discussion?
Alright, here is the plugin with a few changes: 1. added 'MobileFriendly' => true, to PluginInfo array so that your plugin would also be available on mobile browsers 2. I understood that you have a problem with the short array notation: only using [1,2,3] instead of array(1,2,3) isn't working for you. You should update… -
Re: Anyone know of an addon to ban users from a discussion?
11 results