Page 1 of 1

Form to post new topic

Posted: Wed Jul 23, 2008 2:00 pm
by callumacrae
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.

Re: Form to post new topic

Posted: Wed Jul 23, 2008 3:12 pm
by MHobbit
Moved to the MOD Requests forum.

Re: Form to post new topic

Posted: Thu Jul 24, 2008 9:56 am
by callumacrae
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.

Re: Form to post new topic

Posted: Fri Aug 29, 2008 5:21 pm
by callumacrae
bump :D