Passing Subject and Message Body in new post

Temporary forum to obtain support while phpBB.com is offline.
Please use the support forum on phpBB.com
Forum rules
Temporary forum to obtain support while phpBB.com is offline.
Please use the support forum on phpBB.com
Locked
User avatar
SGBoise
Registered User
Posts: 3
Joined: Fri Feb 06, 2009 7:31 pm
Contact:

Passing Subject and Message Body in new post

Post by SGBoise » Fri Feb 06, 2009 7:40 pm

Hello,

I would like to be able to specify the the subject and the body message for a new post. Is there a way to mod or not so that I can pass the subject and message body in a link.

For example something like this:
http://www.gamepacks.org/forum/posting. ... 20a%20test.

Thanks in advanced. :D

User avatar
darcie
Community Team
Community Team
Posts: 189
Joined: Mon Mar 12, 2007 7:32 pm
Location: Davis, California
Contact:

Re: Passing Subject and Message Body in new post

Post by darcie » Fri Feb 06, 2009 8:02 pm

As noted in the source code of your forum, we cannot support your board if you have removed the copyright information:
<!--
We request you retain the full copyright notice below including the link to http://www.phpbb.com.
This not only gives respect to the large amount of time given freely by the developers
but also helps build interest, traffic and use of phpBB3. If you (honestly) cannot retain
the full copyright we ask you at least leave in place the "Powered by phpBB" line, with
"phpBB" linked to http://www.phpbb.com. If you refuse to include even this then support on our
forums may be affected.

The phpBB Group : 2006
//-->
If you would like to continue to get support from this site or phpbb.com, when available, please replace the copyright information to the overall_footer.html of your site. The minimum required is:

Code: Select all

Powered by <a href="http://www.phpbb.com/">phpBB</a> 
Please PM me or another team member when this is replaced to have your topic reopened.

User avatar
darcie
Community Team
Community Team
Posts: 189
Joined: Mon Mar 12, 2007 7:32 pm
Location: Davis, California
Contact:

Re: Passing Subject and Message Body in new post

Post by darcie » Fri Feb 06, 2009 10:32 pm

Copyright restored; topic reopened.

jage
Registered User
Posts: 19
Joined: Fri Feb 06, 2009 6:47 pm

Re: Passing Subject and Message Body in new post

Post by jage » Fri Feb 06, 2009 11:41 pm

SG, your link takes me to a login/register screen. Might want to make a test acccount so people can see your example without too much hassle.

User avatar
darcie
Community Team
Community Team
Posts: 189
Joined: Mon Mar 12, 2007 7:32 pm
Location: Davis, California
Contact:

Re: Passing Subject and Message Body in new post

Post by darcie » Fri Feb 06, 2009 11:45 pm

He's giving the link as an example of how he would like to use the link to post the subject. It isn't the location of the link that is the example but the link itself. See here for the entire sample url:

Code: Select all

http://www.gamepacks.org/forum/posting.php?mode=post&f=5&subject=This%20Subject&body=This%20is%20a%20test

User avatar
SGBoise
Registered User
Posts: 3
Joined: Fri Feb 06, 2009 7:31 pm
Contact:

Re: Passing Subject and Message Body in new post

Post by SGBoise » Sat Feb 07, 2009 12:18 am

Thanks Darcie. :D

The link is just an example but if it can be done with a post I can do it that way also.

This is a link to start a new post and f is the forum to post.

Code: Select all

http://www.gamepacks.org/forum/posting.php?mode=post&f=5
GamePacks.org - Products for the Arcade/Media Community
Video Script - The ultimate media site script
Youtube Sharing Script - Run your own youtube sharing site

jage
Registered User
Posts: 19
Joined: Fri Feb 06, 2009 6:47 pm

Re: Passing Subject and Message Body in new post

Post by jage » Sat Feb 07, 2009 4:30 am

Ok, so in other words when I click New Topic you want to populate the Subject with "Jage Writes:" and the body with "Write your letter here"?

Is that right? Do the messages change? Is there a limited set of topics depending on criteria, or is it actually something you need to pass through the URL? (e.g. could you pass a subject=3&body=urgent)?

Essentially you need to pick up the variable (this is from ucp_register.php adding basic_math value):

Code: Select all

		$data = array(
			'username'			=> utf8_normalize_nfc(request_var('username', '', true)),
			'new_password'		=> request_var('new_password', '', true),
			'password_confirm'	=> request_var('password_confirm', '', true),
			'email'				=> strtolower(request_var('email', '')),
			'email_confirm'		=> strtolower(request_var('email_confirm', '')),
			'confirm_code'		=> request_var('confirm_code', ''),
			'basic_math'		=> request_var('basic_math', ''),
			'lang'				=> basename(request_var('lang', $user->lang_name)),
			'tz'				=> request_var('tz', (float) $timezone),
		);
But depending on where and how you want to then use what in this case is $data['basic_math'] you'll probably do something like:
(this is cut down and not a real example since I process the basic math in the file for other purposes)

Code: Select all

		$template->assign_vars(array(
			'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '',
			'USERNAME'			=> $data['username'],
			'PASSWORD'			=> $data['new_password'],
			'PASSWORD_CONFIRM'	=> $data['password_confirm'],
			'EMAIL'				=> $data['email'],
			'EMAIL_CONFIRM'		=> $data['email_confirm'],
			'CONFIRM_IMG'		=> $confirm_image,
			'BASIC_MATH' => $data ['basic_math'],
			'S_LANG_OPTIONS'	=> language_select($data['lang']),
			'S_TZ_OPTIONS'		=> tz_select($data['tz']),
			)
		);
In which case in the html template I can now use {BASIC_MATH} such as:

Code: Select all

<input type="text" name="basic_math" value="{BASIC_MATH}">
I can probably give you better specifics depending on, again, what exactly you're trying to accomplish.... I can't guarentee my solutions or code fits in with the established way to do phpbb changes.

User avatar
SGBoise
Registered User
Posts: 3
Joined: Fri Feb 06, 2009 7:31 pm
Contact:

Re: Passing Subject and Message Body in new post

Post by SGBoise » Sat Feb 07, 2009 5:56 pm

Thanks Jage. I think that's exactly what I'm looking for. :P :P
GamePacks.org - Products for the Arcade/Media Community
Video Script - The ultimate media site script
Youtube Sharing Script - Run your own youtube sharing site

Locked