Phpbb3 online form post...

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)
Suggested Hosts
Locked
Alterno
Registered User
Posts: 218
Joined: Thu Apr 19, 2007 8:25 pm

Phpbb3 online form post...

Post by Alterno »

Greetings,

I was wondering if is possible to create an online form integrating the phpbb3 technology to it. What I'm looking forward to do is create an application form that post every field into a post in X forum once he submit the information..

Or I would like to use the custom regristration field to be posted in the application forum, can it be done?
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: Phpbb3 online form post...

Post by ameeck »

This is probably the definition of a spambot :)
Alterno
Registered User
Posts: 218
Joined: Thu Apr 19, 2007 8:25 pm

Re: Phpbb3 online form post...

Post by Alterno »

ameeck wrote:This is probably the definition of a spambot :)
????
Alterno
Registered User
Posts: 218
Joined: Thu Apr 19, 2007 8:25 pm

Re: Phpbb3 online form post...

Post by Alterno »

well I all i want is some users to fill some fields and after they click submit... they'll be posted @ a forum. Something like this http://www.phpbb.com/community/viewtopic.php?t=289814, but for phpbb.
User avatar
Typo
Former Team Member
Posts: 404
Joined: Tue Dec 30, 2008 6:12 am
Location: USA
Name: Jeremy Lorenzo
Contact:

Re: Phpbb3 online form post...

Post by Typo »

I get it, you want to be able to use a standard form on a non-phpbb page that will take the info and post it into your phpbb3 forum. Am I on the right track?

If I am guessing correctly, a proper example for instance, would be....lets say the user had a portal, they could have a contact the admin form that asks for name, problem and then lets u post a message, u fill it out, hit submit and it takes the info and posts it as a new topic in a forum.

Typo
Chukibu
Registered User
Posts: 1
Joined: Sun Jun 07, 2009 8:41 pm

Re: Phpbb3 online form post...

Post by Chukibu »

I found this online, Fragnader made it, so all credit to him.

I'm not very familiar with phpbb, as I just switched over from SMF. But it doesn't seem to be able to recognize if you're logged in. Other than that, it seems to work just fine (Removing the part checking if you were logged in, I was able to use the form to post Anonymously).

If anyone could take a look and see how to fix it, would appreciate it.

Here's the two files:

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);


// Start session management
$user->session_begin();
$auth->acl($user->data);

if ($user->data['username'] == "Anonymous" || $user->data['username']== "Guest")
{
echo "Please Login to the forums and try again.";
}
//echo "<script type=\"text/javascript\">".
//"window.close();".
//"</script>";
else
{
echo "<html>
<head><title>America's Army Application Form</title></head>
<body>
<form action='poster.php' method='post'>
Enter your America's Army Username: <input type='text' size='25' name='username' /><br>
Enter your PB Guid: <input type='text' MAXLENGTH='32' size='40' name='guid' /><br>
Enter your Age: <input type='text' MAXLENGTH='2'size='2' name='age' /><br>
Enter your Tracker ID: <input type='text' name='trackid' /><br>
Do you have a mic? <input type='text' name='mic' /><br>
Do you have Vent? <input type='text' name='vent' /><br>
Have you ever been banned by an Anti Cheating Community. If yes, Why? <input type='text' name='banned' /><br>
Why do you want to join this clan: <input type='text' name='reason' /><br>
If someone invited you to join the clan, please state his/her name: <input type='text' name='ref' /><br><br>
<input type='submit' />
</form>
</body>
</html>";
}


?>

Code: Select all

<?php

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);

//Yeah, I know this is not needed but I did it for simplicity
$username = $_POST["username"];
$guid = $_POST["guid"];
$age = $_POST["age"];
$tracker = $_POST["trackid"];
$microphone = $_POST["mic"];
$vent = $_POST["vent"];
$banned = $_POST["banned"];
$reason = $_POST["reason"];
$ref = $_POST["ref"];
$ip = $_SERVER["REMOTE_ADDR"];

$message = "AA Username: $username
PB Guid: http://www.hazardaaclan.com/history/accounthistory.php?guid=$guid
Age: $age
Tracker ID: http://aaotracker.com/usertracker.php?userid=$tracker
Mic? $microphone
Ventrilo? $vent
Banned? $banned
Reason for wanting to join? $reason
Refered by: $ref";

$time = time();

// note that multibyte support is enabled here
$rawsubject = "Americas Army Application for $username";
$my_subject	= utf8_normalize_nfc($rawsubject, '', true);
$my_text	= utf8_normalize_nfc($message, '', true);

// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = ''; 

generate_text_for_storage($my_subject, $uid, $bitfield, $options, false, false, false);
generate_text_for_storage($my_text, $uid, $bitfield, $options, true, true, true);

$data = array( 
	'forum_id'		=> 32,
	'icon_id'		=> false,

	'enable_bbcode'		=> true,
	'enable_smilies'	=> true,
	'enable_urls'		=> true,
	'enable_sig'		=> true,

	'message'		=> $my_text,
	'message_md5'	=> md5($my_text),
				
	'bbcode_bitfield'	=> $bitfield,
	'bbcode_uid'		=> $uid,

	'post_edit_locked'	=> 0,
	'topic_title'		=> $my_subject,
	'notify_set'		=> false,
	'notify'			=> false,
	'post_time' 		=> 0,
	'forum_name'		=> '',
	'enable_indexing'	=> true,
);

submit_post('post', $my_subject, $user->data['username'], POST_NORMAL, $poll, $data);

echo "Application Submitted, You may close this window.";

?>
eklisiarh
Registered User
Posts: 10
Joined: Mon Aug 24, 2009 8:47 am

Re: Phpbb3 online form post...

Post by eklisiarh »

I also need this! Bump
tsavory
Registered User
Posts: 11
Joined: Sat Aug 30, 2008 4:42 am

Re: Phpbb3 online form post...

Post by tsavory »

I also need something like this or even a way to make every reply in a certain topic contain the certain set of text such as in forum a the topic is info for requesting an online survey reason title a list of questions and answers every time someone hit the reply they get text already asking the reason the title and a list of questions and answers
and this only shows up in the topic in question
chainprayer
Registered User
Posts: 162
Joined: Sat Sep 08, 2007 5:25 pm
Contact:

Re: Phpbb3 online form post...

Post by chainprayer »

Anybody have luck with the code above? I need the same thing for an osx dashboard widget im making for my site
chainprayer
Registered User
Posts: 162
Joined: Sat Sep 08, 2007 5:25 pm
Contact:

Re: Phpbb3 online form post...

Post by chainprayer »

Thanks for the code! I applied it to my widget and have it working perfectly now!
Tim81
Registered User
Posts: 20
Joined: Tue Aug 31, 2010 12:55 pm
Location: The Netherlands

Re: Phpbb3 online form post...

Post by Tim81 »

I would be also interested in this type of form - however I need my users to be logged in, so no anonymous fillouts. The topic it will create would be on a forum that is not (yet) visible to the users, only to administrators / and users that have permission for that.
Locked

Return to “[3.0.x] MOD Requests”

cron