Form to post new topic

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
Locked
User avatar
callumacrae
Former Team Member
Posts: 2662
Joined: Tue Feb 12, 2008 12:28 pm
Location: London, UK
Name: Callum Macrae
Contact:

Form to post new topic

Post by callumacrae » Wed Jul 23, 2008 2:00 pm

I need a forum that connects to the database and posts as a bot.

I don't really know how PhpBB3 works, but I want it to do the following:

Collects the following information:
user name
password
reason for unsuspention (temp ban)

it then validates the username against the password and then, if correct posts into forum id 63 as "unsuspension request [bot]" with:

Code: Select all

[b]User Name:[/b]: {user_name}

[b]Suspension Reason:[/b] {Reason for suspension}

[b]Reason for Unsuspension:[/b] {Reason for unsuspension}
If anyone can do this, thanks.
macr.ae = my website. you probably won't like it.
Proud user ofProud user of

User avatar
MHobbit
Former Team Member
Posts: 4761
Joined: Thu Mar 18, 2004 5:32 pm
Location: There and Back Again

Re: Form to post new topic

Post by MHobbit » Wed Jul 23, 2008 3:12 pm

Moved to the MOD Requests forum.
Former phpBB MOD Team member
No private support is offered.
"There’s too many things to get done, and I’m running out of days..."

User avatar
callumacrae
Former Team Member
Posts: 2662
Joined: Tue Feb 12, 2008 12:28 pm
Location: London, UK
Name: Callum Macrae
Contact:

Re: Form to post new topic

Post by callumacrae » Thu Jul 24, 2008 9:56 am

It's been moved twice now :)

unsusp.php:

Code: Select all

<?php
switch (@$_REQUEST['mode'])
{
case "a":
if (isset($_GET['username']) && isset($_GET['password"]) && isset($_GET['reason']))
{
$username = $_GET['username'];
$password = $_GET['password'];
$reason = $_GET['reason'];

if (%HELP0%)
{
INSERT INTO `phpbb_topics` VALUES( %HELP1% , 19, 63, 0, 1, 0, 'Unsuspension Request', 258, %HELP2%, 0, 0, 0, 0, 0, 0, %HELP3%, 'Unsuspension Request [bot]"', '9E8DA7', %HELP3%, 258, 'Unsuspension Request [bot]', '9E8DA7', '', %HELP2%, %HELP2%, 0, 0, 0, '', 0, 0, 1, 0, 0, 0, 0, 0);

$post = "[b]User Name:[/b] $username
[b]Reason for Unsuspension:[/b] $reason";

INSERT INTO `phpbb_posts` VALUES(%HELP3%, %HELP1%, 63, 258, 0, '%HELP4%', %HELP2%, 1, 0, 1, 1, 1, 1, '', 'Unsuspension Request', ' $post', '%HELP5%', 0, '', '%HELP5%', 1, 0, '', 0, 0, 0, 0, 0);
}else{
die("Password incorrect");
}
}else{
die("Some information wasn't specified. Please try again.")
}
break;
default:
echo "<form action=\"./unsusp.php\" method=\"post\">
<input type=\"hidden\" name=\"mode\" value=\"a\" />
<input type=\"text\" name=\"username\" />
<input type=\"password\" name=\"password\" />
<input type=\"text\" name=\"reason\" />
<input type=\"submit\" value=\"submit\" />
</form>";
}
?>
HELP0: How do I compare the password?
HELP1: How would I get the topic ID?
HELP2: What function to get the time?
HELP3: How to get this ID?
HELP4: What shall I put for IP address?
HELP5: What is this?

Sorry about my horrid code.

I have the soft delete MOD installed.
macr.ae = my website. you probably won't like it.
Proud user ofProud user of

User avatar
callumacrae
Former Team Member
Posts: 2662
Joined: Tue Feb 12, 2008 12:28 pm
Location: London, UK
Name: Callum Macrae
Contact:

Re: Form to post new topic

Post by callumacrae » Fri Aug 29, 2008 5:21 pm

bump :D
macr.ae = my website. you probably won't like it.
Proud user ofProud user of

Locked

Return to “[3.0.x] MOD Requests”