Ross
asked on
Delete all forum posts (vbulletin/php)
I am a user on a forum and now want to delete all posts I have made from that forum. I can manually goto each post, click edit, click delete, and delete the posts. However, this is not a pratical solution for a large number of posts (>5k).
I'm sure there must be a way using php to cycle through the posts if I have a list of the post/thread id's to systematically delete the posts.
The vbulletin forum code taken from the delete post bit looks like this:
If I have both the thread id the post is in, and the post id itself for every post, can anyone think of a way to cycle through this list automatically deleting the posts by using the above code? Cheers :)
Ross
I'm sure there must be a way using php to cycle through the posts if I have a list of the post/thread id's to systematically delete the posts.
The vbulletin forum code taken from the delete post bit looks like this:
<form class="vbform block" action="editpost.php?do=deletepost&p=1387087" method="post">
<h2 class="blockhead">Delete Post</h2>
<div class="blockbody formcontrols">
<h3 class="blocksubhead">Select the appropriate options and then click the <strong>Delete</strong> button.</h3>
<div class="section">
<div class="blockrow">
<dl class="dep_group">
<dt><label for="delete"><input type="checkbox" class="dep_ctrl" id="delete" name="dodelete" value="1" tabindex="1" /> Delete this post in the following manner:</label></dt>
<dd id="delete_deps">
<ul class="group checkradio">
<li>
<dl class="group dep_group floatcontainer">
<dt><label for="deltype_soft"><input type="radio" id="deltype_soft" checked="checked" class="dep_ctrl" name="deletepost" value="delete" tabindex="1" /> Delete Message</label></dt>
<dd id="deltype_soft_deps">
<input type="text" name="reason" class="textbox primary" value="" tabindex="1" />
</dd>
</dl>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</div>
<div class="blockfoot actionbuttons">
<div class="group">
<input type="submit" class="button" value="Delete Post" tabindex="1" />
</div>
</div>
<input type="hidden" name="s" value="" />
<input type="hidden" name="securitytoken" value="1303979356-07f41ff782fe86f8f02350cd2d1a73d620a65ee3" />
<input type="hidden" name="p" value="1387087" />
<input type="hidden" name="url" value="www.thewebsite.com/forums/showthread.php?127861" />
<input type="hidden" name="do" value="deletepost" />
</form>
If I have both the thread id the post is in, and the post id itself for every post, can anyone think of a way to cycle through this list automatically deleting the posts by using the above code? Cheers :)
Ross
ASKER
No I'm not - if I was it'd be easy like you say :)
I need a way to do this just with my regular forum rights. Any ideas?
I need a way to do this just with my regular forum rights. Any ideas?
not offhand, no. Normal forum authentication and security will prevent you from carrying functions like that out. All forums I know of will validate each of those requests by session / user authentication, which you wouldn't have since the script would not be running on the forum host server.
I would probably request assistance from a forum admin. I know SMF for example has a standard admin option to remove a forum account along with all posts and threads associated with it. Then if you still wanted an account there you could just re-create it.
I would probably request assistance from a forum admin. I know SMF for example has a standard admin option to remove a forum account along with all posts and threads associated with it. Then if you still wanted an account there you could just re-create it.
ASKER
What about something like a vba action that fires a browser session to do it? That way we're already authenticated via the cookie? Can we pass the delete command in the URL on it's own?
Since you don't have access to the database, it won't be as simple as it could be.
Create PHP cURL script to access the forum and delete each post for you.
Create PHP cURL script to access the forum and delete each post for you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
solutions posted here didn't address my issue - went to private coder.
For a large number like that I would think the easiest way would be a simple mysql query to remove all posts that match your userID. I would highly recommend doing a backup first though if this is even an option for you.