3raser Posted March 6, 2012 Share Posted March 6, 2012 How would I go about making a small feature for my moderators that allows them to select multiple threads while viewing a forum then take action? All I need is an idea of how I would do this. Wouldn't I use the explode() function? Example: http://i490.photobucket.com/albums/rr267/brannenclass/ex.png Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/ Share on other sites More sharing options...
thegate Posted March 6, 2012 Share Posted March 6, 2012 If you want to preform the same action on all of the selected fields, you could just loop through them, right? Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324607 Share on other sites More sharing options...
ManiacDan Posted March 6, 2012 Share Posted March 6, 2012 Asking "would I use explode" is like asking "how would I climb a mountain, would I use a rope?" Yes, you would...and 5,000 other things. If you want to allow people to select multiples of something, name the checkboxes "selection[]" and put the values as the IDs you want to select. Then $_POST['selection'] will be an array of the items selected. You can loop through them using foreach. Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324614 Share on other sites More sharing options...
3raser Posted March 6, 2012 Author Share Posted March 6, 2012 Asking "would I use explode" is like asking "how would I climb a mountain, would I use a rope?" Yes, you would...and 5,000 other things. If you want to allow people to select multiples of something, name the checkboxes "selection[]" and put the values as the IDs you want to select. Then $_POST['selection'] will be an array of the items selected. You can loop through them using foreach. Thank you. Sorry for asking the question. I always want to be sure before going through with something. Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324620 Share on other sites More sharing options...
3raser Posted March 6, 2012 Author Share Posted March 6, 2012 For each individual thread that is echoed out, would I add a new form? I tried making the form tag spread from before the threads start echoing, to after. But that made my site look a little weird. Is there any possible way I can add a checkbox before each individual title, and have it assigned to a form? I don't think it's possible, though. This is what I was trying to do, but it made my site look a little odd: echo '<form action="test.php" method="POST">'; while($row = blah) { echo '<input type="checkbox" name="action[]" value="'. $row['id'] .'">'.$row['title']; } echo '</form>'; Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324641 Share on other sites More sharing options...
xyph Posted March 6, 2012 Share Posted March 6, 2012 You didn't get the point of ManiacDan's comment. You're being FAR too vague. Your issue is markup. I'd suggest using a Cascading Style Sheet to modify the way your elements appear. This is no longer a PHP issue, but an HTML issue. You're on the right track though. Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324652 Share on other sites More sharing options...
3raser Posted March 6, 2012 Author Share Posted March 6, 2012 You didn't get the point of ManiacDan's comment. You're being FAR too vague. Your issue is markup. I'd suggest using a Cascading Style Sheet to modify the way your elements appear. This is no longer a PHP issue, but an HTML issue. You're on the right track though. Thank you for the response. I'm going with the exact idea that ManiacDan gave me. And regarding the CSS, I'll try and do a quick fix from there and see if I can get anything working. Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324657 Share on other sites More sharing options...
ManiacDan Posted March 7, 2012 Share Posted March 7, 2012 You must wrap the entire list in a single form tag, only one form can be submitted at a time. If the problem is now "my site looks all weird," then xyph is right, your problem is a style one not a PHP one. Quote Link to comment https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/#findComment-1324727 Share on other sites More sharing options...
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.