Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2013-03-23 01:10:20

CRLin
Member
From: Taiwan
Registered: 2011-02-17
Posts: 64
Website

[MOD] Contact

Demo: http://fluxbbtw.heliohost.org/forums/contact.php
Download: http://fluxbb.org/resources/mods/contact/

Put contact.php in Fluxbb root directory.
PS: you can edit line 11

$to = ""; //Fill your email

Last edited by CRLin (2013-05-17 01:03:06)

Offline

#2 2013-03-23 01:13:52

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,782
Website

Re: [MOD] Contact

Cool!

You might want to upload this to our modification repository.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#3 2013-03-23 06:30:59

CRLin
Member
From: Taiwan
Registered: 2011-02-17
Posts: 64
Website

Re: [MOD] Contact

Add to modification repository.

Offline

#4 2013-05-16 14:17:21

ehtime
Member
Registered: 2009-06-18
Posts: 133
Website

Re: [MOD] Contact

Failed to send mail!

I have put contact.php in my Fluxbb root directory. like:www.abc.com/bbs/contact.php
and I have edited line 50.

translate it to Chinese:

測試了一下,遊客訪問該鏈接發送郵件,提示郵件未能發送;但是會員登錄後,Fluxbb自己的會員間發送郵件的功能是正常的。另外,如果這個能擴展一下,做成遊客在訪問各會員的 Profile 頁面時,可向該會員發送郵件就更Cool了。

Offline

#5 2013-05-17 01:21:23

CRLin
Member
From: Taiwan
Registered: 2011-02-17
Posts: 64
Website

Re: [MOD] Contact

Updated! Add send mail by SMTP.

感謝 ehtime 測試!
我的演示 http://fluxbbtw.heliohost.org/forums/contact.php 免不了收到垃圾郵件,因此加了驗證,於 http://fluxbb.org/resources/mods/contact/ 提供的並無驗證功能。

ehtime wrote:

如果這個能擴展一下,做成遊客在訪問各會員的 Profile 頁面時,可向該會員發送郵件就更Cool了。

那就更須驗證
修改 Contact v1.1,應當很容易做到你所要的! smile

Last edited by CRLin (2013-05-17 02:08:46)

Offline

#6 2013-05-17 03:48:00

ehtime
Member
Registered: 2009-06-18
Posts: 133
Website

Re: [MOD] Contact

Failed opening required '...lang/English/address.php'

Forgot something?

Offline

#7 2013-05-18 01:17:25

CRLin
Member
From: Taiwan
Registered: 2011-02-17
Posts: 64
Website

Re: [MOD] Contact

ehtime wrote:

Failed opening required '...lang/English/address.php'

Forgot something?

Sorry! Correct bug.
Find

else
  require PUN_ROOT.'lang/English/address.php';

Replace with

elseif (file_exists(PUN_ROOT.'lang/English/address.php'))
  require PUN_ROOT.'lang/English/address.php';

My lang/Simplified_Chinese/address.php

<?php

// Language definitions used in address.php
$lang_address = array(

'Communications details legend'		=>	'输入您的通讯资料',
'Name'								=>	'姓名',
'Mobile phone'						=>	'手机',
'Phone1'							=>	'电话(1)',
'Phone2'							=>	'电话(2)',
'Address'							=>	'地址',
'Logout address'					=>	'登出通讯录',
'Must login'						=>	'必须登入',
'Display explain'					=>	'点击 是/否 以 显示/隐藏 栏位',
'Display'							=>	'显示',
'Yes'								=>	'是',
'No'								=>	'否',
'Add registered user errors'		=>	'添加注册用户出错',
'Add registered user errors info'	=>	'在继续添加注册用户前您必须修正以下错误:',
'Add registered user redirect'		=>	'添加注册用户成功。正在跳转 …',

// Guest login
'Wrong password'					=>	'错误的公用密码。',
'Login legend'						=>	'在此输入公用密码,可点击 %s这里%s 以用户名、密码登入。',

// Last topics
'Last topics'						=>	'最后讨论的 %s 个主题',
'Last topic'						=>	'最后讨论的 %s 个主题',

// Contact
'Contact me'						=>	'连络站长'

);

Last edited by CRLin (2013-05-18 01:46:00)

Offline

#8 2013-07-21 08:59:09

nono18120
Member
Registered: 2012-07-20
Posts: 52

Re: [MOD] Contact

hello,


how to install a captchat on this form!


thank you

Offline

#9 2013-07-25 00:29:09

CRLin
Member
From: Taiwan
Registered: 2011-02-17
Posts: 64
Website

Re: [MOD] Contact

nono18120 wrote:

how to install a captchat on this form!

If you hadn't installed MOD VSABR, save the following codes to lang/English/mod_very_simple_antibot.php

<?php
// Language string for mod Very Simple AntiBot Registration

$lang_mod_vsabr = array(
  'Robot title'      => 'Are you human or robot?',
  'Robot question'   => 'Please respond with a <b>number</b> to the question: <b>%s</b>',
  'Robot info'       => 'Checking if this is requested by a real person and not an automated program.',
  'Robot test fail'  => 'You answered incorrectly to the "Human or Robot" question, or you are a Bot!',
);

// [modif oto] [Very Simple AntiBot questions]
$mod_vsabr_questions = array(
  'What is two plus two?'     => 4,
  'What is four minus one?'   => 3,
  'What is three plus two?'   => 5,
  'What is two times four?'   => 8,
  'What is five minus two?'   => 3,
  'What is six plus three?'   => 9,
  'What is seven minus one?'  => 6,
  'What is eight times two?'  => 16,
  'What is six times two?'    => 12,
  'What is nine minus seven?' => 2
);
?>

Open contact.php
Find

require PUN_ROOT.'lang/'.$pun_user['language'].'/misc.php';

After, add

if(file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/mod_very_simple_antibot.php'))
  require PUN_ROOT.'lang/'.$pun_user['language'].'/mod_very_simple_antibot.php';
else
  require PUN_ROOT.'lang/English/mod_very_simple_antibot.php';
$mod_vsabr_index = rand(0,count($mod_vsabr_questions)-1);

Find

$required_fields = array('username' => $lang_address['Name'], 'Email' => $lang_common['Email'], 'Subject' => $lang_misc['Email subject'], 'Message' => $lang_misc['Email message']);

After, add

$required_fields['captcha'] = $lang_mod_vsabr['Robot title'];

Find

	$email1 = strtolower(pun_trim($_POST['Email']));

After, add

	$mod_vsabr_p_question = isset($_POST['captcha_q']) ? trim($_POST['captcha_q']) : '';
	$mod_vsabr_p_answer = isset($_POST['captcha']) ? trim($_POST['captcha']) : '';
	$mod_vsabr_questions_array = array();
	foreach ($mod_vsabr_questions as $k => $v)
		$mod_vsabr_questions_array[md5($k)] = $v;
	if (empty($mod_vsabr_questions_array[$mod_vsabr_p_question]) || $mod_vsabr_questions_array[$mod_vsabr_p_question] != $mod_vsabr_p_answer)
	$errors[] = $lang_mod_vsabr['Robot test fail'];

Find

			<p class="buttons"><input type="submit" name="contact" value="<?php echo $lang_common['Submit'] ?>" /></p>

Before, add

			<div class="inform">
				<fieldset>
				<legend><?php	echo $lang_mod_vsabr['Robot title']	?></legend>
				<div class="infldset">
					<p><?php echo	$lang_mod_vsabr['Robot info']	?></p>
					<label class="required"><strong><?php
						$question = array_keys($mod_vsabr_questions);
						$qencoded = md5($question[$mod_vsabr_index]);
						echo	sprintf($lang_mod_vsabr['Robot question'],$question[$mod_vsabr_index]);?>
						<span><?php echo	$lang_common['Required'] ?></span></strong>
						<input	name="captcha" id="captcha"	type="text"	size="10"	maxlength="30" /><input name="captcha_q"	value="<?php echo	$qencoded	?>"	type="hidden"	/><br	/>
					</label>
				</div>
				</fieldset>
			</div>

Offline

#10 2013-07-25 05:15:44

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Re: [MOD] Contact

Great mod, just a couple of things;

How can I format the email success message? I've changed the success message text but not sure how to add a border around it and colored background to suit the rest of my site.

Could you also suggest a way to include the senders IP address in the email?

If a user submits a message and reaches the message successfully sent page, if they refresh that page it re-sends the message again, this could be very bad for spam attacks.

Squiggles.

Last edited by Squiggles (2013-07-25 06:00:38)

Offline

#11 2013-07-26 09:19:43

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Re: [MOD] Contact

I've worked together with a PHP developer to integrate secureimage captcha as well as IP logging to this contact form. I have also added a redirect landing page for the success message to prevent the refresh / send issue, it also provides easier customisation.

The next thing I want to do is add a pre-defined drop down menu and attachment facility. After that with the authors permission I will share it for everyone else to use also.

Squiggles.

Offline

#12 2013-07-28 13:59:19

nono18120
Member
Registered: 2012-07-20
Posts: 52

Re: [MOD] Contact

hello,

that functions very well  but I have worries of appearance as is what I can regulate this problem thank you!

232660Capture.jpg


thank you very much for your assistance

Last edited by nono18120 (2013-07-28 14:33:39)

Offline

Board footer

Powered by FluxBB 1.5.6