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?
ok so I get that I should see some output when hitting submit from what is in the first part of the if/else statement but nothing shows up. If I put an echo in the else statement I do see that returned so I understand how it is supposed to work but that decho isn't returning anything for me. After clicking the button it… -
Re: Anyone know of an addon to ban users from a discussion?
Now that you've saved to the db, use the discussionModel to get the discussion by its id before the form is displayed (in the other part of the if clause). Make sure the permission check is working! After that get the discussion (look at the DiscussionModel to find the right method) and put a decho($discussion,… -
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?
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?
You're almost there! You just need some more understanding of the scope of variables. Inside of your function you only have two variables: $sender and $args. $sender is an instance of the CommentModel. It is always worth checking if a class provides a property that could be helpful. In this case, there is no helpful… -
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?
Great that you solve the issue, which isn't an embed issue but a mistake I make quite often: I have the bad habit to use absolute paths :( In fact you plan to not really see anything when hitting the submit button, though getting some kind of response would be nice. Here is what should work in any case (but it wouldn't be… -
Re: Anyone know of an addon to ban users from a discussion?
Well, indeed strange, but as long as it works... Sending a notification to a user is quite complicated. What about addding a css class to a discussion where you are banned? And/or output some message to the user at the only place where it is important for him: at the comment box. Look at those two lines, they are very… -
Re: Anyone know of an addon to ban users from a discussion?
If a link has the class "Popup", Vanilla uses Javascript to open the link as a popup. In the text you post was a typo. Most of the code I write down here is completely untested and it might be full of typos and do not even work at all. But most of the time you should be able to make it work with just a few adjustments. If… -
Re: Anyone know of an addon to ban users from a discussion?
$something->$anything would never work. The dollar sign is for variables. The -> connector is used to call methods of objects. I guess $sender is still unclear. When Vanilla calls the method in your plugin, it passes an instance of the current class to your plugin. Since you are using DiscussionController right now,…
24 results