Recent Topics

1 Feb 08, 2009 16:06    

My b2evolution Version: 2.4.6
Hi,
i am looking to completely change the contact form into a clan application form and needed some hints an how to change it or maybe just create a new one. I tried using search for similar questions but couldn't really solve my problem ><.
What i am gonna need is:

User name
Game experiences
Msn contact
Mail contact
...and more

This information has to be sent to the a specific email...

Any answer will be appreciated :)
Thank You

2 Feb 08, 2009 17:55

Hi percl. Welcome to the forums. This will be easy breezy pretty pleasy ... assuming you're up to copying files and hacking the living snot out of 'em. ;)

Search the forums for "custom disp" because step one will be ... well it *should be* creating a situation where "disp=clanapp" has value. But you could just hack the hell out of the real contact form so that "disp=msgform" will do the job. The thing is then you lose the message form. So find how to do that - it is in the forums somewhere - and get 'er done. I'm pretty sure it is really easy - something simple in the skin but I always over-hack everything.

ANYWAY after that you would copy /skins/_msgform.disp.php as /skins/_clanapp.disp.php and get ready to edit it. Oh wait you gotta copy /htsrv/message_send.php as /htsrv/clanapp_send.php too, and get ready to edit that one. They work hand in hand is the thing.

That will take care of getting something in place that you can then turn into what you need. And here's a hint on all the hacking you'll be doing. Back in _clanapp.disp.php find this bit:

Most of the hacking you'll have to take care of yourself. Sorry, but I ain't into building the whole thing for ya. Anyway in _clanapp.disp.php find this:

$Form = new Form( $htsrv_url.'message_send.php' );

and change it to this:

$Form = new Form( $htsrv_url.'clanapp_send.php' );

Over in clanapp_send.php find this bit at the bottom:

// Send mail
$success_mail = send_mail( $recipient_address, $subject, $message, "$sender_name <$sender_address>" );

Now totally cheat it to send to the very specific person you want:

// Send mail
$recipient_address = "Frodo Baggins  <frodo@theshire.com>";
$success_mail = send_mail( $recipient_address, $subject, $message, "$sender_name <$sender_address>" );

	$Form->text( 'd', $email_author, 40, T_('From'),  T_('Your name.'), 50, 'bComment' );

What that is doing is saying is producing the person's name as the variable "d". clanapp_send.php knows to look for "d" and knows it is a name. So you will want to have something like this probably:

	$Form->text( 'exp', '', 40, T_('Experience'),  T_('Your gaming experience is ... what?.'), 255, 'bComment' );

Then you gotta teach clanapp_send.php what to do with "exp", but I'll leave all the good bits up to you. Helpful hint #2: keep an eye on "d" and "f" and "g" in the clanapp_send.php file to get an idea of how to put your new fields in the same sort of way.

Have fun!

3 Feb 08, 2009 20:51

First of all Thank You for your answer, i am working on it and it seems to go well..i just have a question: is there a way to use radion buttons or dropdown menus instead of text areas in the form? And if possible how do you work that out with the mail ?

Apart from that, how do i add more variables to the send_mail function ? >< sorry i suck ><

Thank you again :)

4 Feb 08, 2009 21:31

Yup. You're gonna love the answer: code it like it was html ;)

After you have a text field done, or heck just view the source of your contact message form, you can get a feel for what the HTML it makes is, then just duplicate it for your purposes.


Form is loading...