Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/258411-multi-moderation-tool/
Share on other sites

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.

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.

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?

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.