Well, I found that it basically works. I copied the section you posted above and pasted it in modcp/thread.php just above the print_cp_footer() line at the end. But one issue with doing that that I hadn't considered is that all the other functions in modcp/thread.php require the "can mass move" or "can mass prune" permission, so if the moderator doesn't have that permission they won't be able to remove polls either, unless you change the permission checking at the top of the file.
But what might be easier would be to just create another file for it, like killpoll.php. I've done that, and I'm attaching it here. The issue with that one is that any moderator will be able to delete polls. I'm not sure if it's possible or practical to add a moderator permission, so I'm not sure what you want to do. You could edit the code to check for certain userids, for example.
The other thing is that no option shows up on the index page. You can edit the code in modcp/index.php to add it, but it looks like it's also possible to use a plugin at hook mod_index_navigation to add it.
Sorry, I guess this is turning out to be a bit more difficult than I thought.
|